* Rename MAP_PATHSEP to MAP_DIRSEP.
authorPaul Smith <psmith@gnu.org>
Sun, 2 Feb 2014 22:28:46 +0000 (17:28 -0500)
committerPaul Smith <psmith@gnu.org>
Sat, 8 Feb 2014 21:01:10 +0000 (16:01 -0500)
function.c
main.c
makeint.h

index 5752d09bf8a7e9c2a9be9b5e5d815c9ae191757a..72ecb7ff9d51df72a439c7bbe42e7c047989d15e 100644 (file)
@@ -519,7 +519,7 @@ func_notdir_suffix (char *o, char **argv, const char *funcname)
 
   int is_suffix = funcname[0] == 's';
   int is_notdir = !is_suffix;
-  int stop = MAP_PATHSEP | (is_suffix ? MAP_DOT : 0);
+  int stop = MAP_DIRSEP | (is_suffix ? MAP_DOT : 0);
   while ((p2 = find_next_token (&list_iterator, &len)) != 0)
     {
       const char *p = p2 + len - 1;
@@ -572,7 +572,7 @@ func_basename_dir (char *o, char **argv, const char *funcname)
 
   int is_basename = funcname[0] == 'b';
   int is_dir = !is_basename;
-  int stop = MAP_PATHSEP | (is_basename ? MAP_DOT : 0) | MAP_NUL;
+  int stop = MAP_DIRSEP | (is_basename ? MAP_DOT : 0) | MAP_NUL;
   while ((p2 = find_next_token (&p3, &len)) != 0)
     {
       const char *p = p2 + len - 1;
@@ -1952,7 +1952,7 @@ func_not (char *o, char **argv, char *funcname UNUSED)
 
 #ifdef HAVE_DOS_PATHS
 # ifdef __CYGWIN__
-#  define IS_ABSOLUTE(n) ((n[0] && n[1] == ':') || STOP_SET (n[0], MAP_PATHSEP))
+#  define IS_ABSOLUTE(n) ((n[0] && n[1] == ':') || STOP_SET (n[0], MAP_DIRSEP))
 # else
 #  define IS_ABSOLUTE(n) (n[0] && n[1] == ':')
 # endif
@@ -1986,9 +1986,9 @@ abspath (const char *name, char *apath)
       strcpy (apath, starting_directory);
 
 #ifdef HAVE_DOS_PATHS
-      if (STOP_SET (name[0], MAP_PATHSEP))
+      if (STOP_SET (name[0], MAP_DIRSEP))
         {
-          if (STOP_SET (name[1], MAP_PATHSEP))
+          if (STOP_SET (name[1], MAP_DIRSEP))
             {
               /* A UNC.  Don't prepend a drive letter.  */
               apath[0] = name[0];
@@ -2008,7 +2008,7 @@ abspath (const char *name, char *apath)
   else
     {
 #if defined(__CYGWIN__) && defined(HAVE_DOS_PATHS)
-      if (STOP_SET (name[0], MAP_PATHSEP))
+      if (STOP_SET (name[0], MAP_DIRSEP))
         root_len = 1;
 #endif
       strncpy (apath, name, root_len);
@@ -2017,7 +2017,7 @@ abspath (const char *name, char *apath)
       /* Get past the root, since we already copied it.  */
       name += root_len;
 #ifdef HAVE_DOS_PATHS
-      if (! STOP_SET (apath[root_len - 1], MAP_PATHSEP))
+      if (! STOP_SET (apath[root_len - 1], MAP_DIRSEP))
         {
           /* Convert d:foo into d:./foo and increase root_len.  */
           apath[2] = '.';
@@ -2037,11 +2037,11 @@ abspath (const char *name, char *apath)
       unsigned long len;
 
       /* Skip sequence of multiple path-separators.  */
-      while (STOP_SET (*start, MAP_PATHSEP))
+      while (STOP_SET (*start, MAP_DIRSEP))
         ++start;
 
       /* Find end of path component.  */
-      for (end = start; ! STOP_SET (*end, MAP_PATHSEP|MAP_NUL); ++end)
+      for (end = start; ! STOP_SET (*end, MAP_DIRSEP|MAP_NUL); ++end)
         ;
 
       len = end - start;
@@ -2054,12 +2054,12 @@ abspath (const char *name, char *apath)
         {
           /* Back up to previous component, ignore if at root already.  */
           if (dest > apath + root_len)
-            for (--dest; ! STOP_SET (dest[-1], MAP_PATHSEP); --dest)
+            for (--dest; ! STOP_SET (dest[-1], MAP_DIRSEP); --dest)
               ;
         }
       else
         {
-          if (! STOP_SET (dest[-1], MAP_PATHSEP))
+          if (! STOP_SET (dest[-1], MAP_DIRSEP))
             *dest++ = '/';
 
           if (dest + len >= apath_limit)
@@ -2072,7 +2072,7 @@ abspath (const char *name, char *apath)
     }
 
   /* Unless it is root strip trailing separator.  */
-  if (dest > apath + root_len && STOP_SET (dest[-1], MAP_PATHSEP))
+  if (dest > apath + root_len && STOP_SET (dest[-1], MAP_DIRSEP))
     --dest;
 
   *dest = '\0';
diff --git a/main.c b/main.c
index 27d3a6eba955d4972123a249a3cf31f5e314b6aa..3a3d0166dfd3c84b6684533dc2c7bad1f081d2c0 100644 (file)
--- a/main.c
+++ b/main.c
@@ -620,11 +620,11 @@ initialize_stopchar_map ()
   stopchar_map[(int)'-'] = MAP_USERFUNC;
   stopchar_map[(int)'_'] = MAP_USERFUNC;
 
-  stopchar_map[(int)'/'] = MAP_PATHSEP;
+  stopchar_map[(int)'/'] = MAP_DIRSEP;
 #if defined(VMS)
-  stopchar_map[(int)']'] = MAP_PATHSEP;
+  stopchar_map[(int)']'] = MAP_DIRSEP;
 #elif defined(HAVE_DOS_PATHS)
-  stopchar_map[(int)'\\'] = MAP_PATHSEP;
+  stopchar_map[(int)'\\'] = MAP_DIRSEP;
 #endif
 
   for (i = 1; i <= UCHAR_MAX; ++i)
index f3f01115cffe2d931edba4bfad29d69d410cafbe..7c695f520f9de1cd50dd8b48ba0cfb512bae4baf 100644 (file)
--- a/makeint.h
+++ b/makeint.h
@@ -397,8 +397,8 @@ extern int unixy_shell;
 #define MAP_USERFUNC    0x2000
 /* This means not only a '$', but skip the variable reference.  */
 #define MAP_VARIABLE    0x4000
-/* The set of characters which are path separators is OS-specific.  */
-#define MAP_PATHSEP     0x8000
+/* The set of characters which are directory separators is OS-specific.  */
+#define MAP_DIRSEP      0x8000
 
 #ifdef VMS
 # define MAP_VMSCOMMA   MAP_COMMA