]> cygwin.com Git - cygwin-apps/setup.git/commitdiff
Remove the function filemanip.cc:base()
authorKen Brown <kbrown@cornell.edu>
Fri, 27 Oct 2017 18:47:21 +0000 (14:47 -0400)
committerJon Turney <jon.turney@dronecode.org.uk>
Sun, 28 Jan 2018 15:10:45 +0000 (15:10 +0000)
This was called only on plain filenames, not full pathnames, so it was not
needed.  Moreover, it wasn't correctly handling filenames containing colons.

filemanip.cc
filemanip.h

index d1d27be8caa3f0a3dd620ff089ea6421ffc7058e..265a2a7830d4297c851d7a560b64797843306b2d 100644 (file)
@@ -43,22 +43,6 @@ get_file_size (const std::string& name)
   return rv;
 }
 
-std::string 
-base (const std::string& aString)
-{
-  if (!aString.size())
-    return "";
-  const char *s = aString.c_str();
-  std::string rv = s;
-  while (*s)
-    {
-      if ((*s == '/' || *s == ':' || *s == '\\') && s[1])
-       rv = s + 1;
-      s++;
-    }
-  return rv;
-}
-
 /* returns the number of characters of path that
  * precede the extension
  */
@@ -89,7 +73,7 @@ parse_filename (const string &fn, fileparse & f)
 
   f.tail = fn.substr (n, string::npos);
 
-  p = new_cstr_char_array (base (fn.substr (0, n)));
+  p = new_cstr_char_array (fn.substr (0, n));
   char const *ext;
   /* TODO: make const and non-const trail variant. */
   if ((ext = trail (p, "-src")))
index 559451935e88571264c5cfbf895a8ffafa35b66d..451211f0458a4a5b9a6de98ff43dc9710ac9f6d0 100644 (file)
@@ -30,7 +30,6 @@ struct fileparse
 };
 
 int parse_filename (const std::string& fn, fileparse & f);
-std::string base (const std::string& );
 size_t get_file_size (const std::string& );
 std::string backslash (const std::string& s);
 const char * trail (const char *, const char *);
This page took 0.090505 seconds and 5 git commands to generate.