This is the mail archive of the cygwin-cvs@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[newlib-cygwin] winsup/utils/dump_setup.cc: Remove the function 'base'


https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=3e8323dc06acd4c1a39b53c38d3bd7acd7102756

commit 3e8323dc06acd4c1a39b53c38d3bd7acd7102756
Author: Ken Brown <kbrown@cornell.edu>
Date:   Tue Oct 24 18:21:53 2017 -0400

    winsup/utils/dump_setup.cc: Remove the function 'base'
    
    This was called only on filenames in /etc/setup/installed.db, which
    are all basenames anyway.  Moreover, base wasn't correctly handling
    filenames containing colons.

Diff:
---
 winsup/utils/dump_setup.cc | 17 +----------------
 1 file changed, 1 insertion(+), 16 deletions(-)

diff --git a/winsup/utils/dump_setup.cc b/winsup/utils/dump_setup.cc
index 320d69f..4415954 100644
--- a/winsup/utils/dump_setup.cc
+++ b/winsup/utils/dump_setup.cc
@@ -48,21 +48,6 @@ find_tar_ext (const char *path)
     return 0;
 }
 
-static char *
-base (const char *s)
-{
-  if (!s)
-    return 0;
-  const char *rv = s;
-  while (*s)
-    {
-      if ((*s == '/' || *s == ':' || *s == '\\') && s[1])
-	rv = s + 1;
-      s++;
-    }
-  return (char *) rv;
-}
-
 /* Parse a filename into package, version, and extension components. */
 int
 parse_filename (const char *in_fn, fileparse& f)
@@ -79,7 +64,7 @@ parse_filename (const char *in_fn, fileparse& f)
   strcpy (f.tail, fn + n);
   fn[n] = '\0';
   f.pkg[0] = f.what[0] = '\0';
-  p = base (fn);
+  p = fn;
   for (ver = p; *ver; ver++)
     if (*ver != '-')
       continue;


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]