(glob): Recognize patterns starting \/.
authordrepper <drepper>
Sun, 7 Oct 2007 18:54:21 +0000 (18:54 +0000)
committerdrepper <drepper>
Sun, 7 Oct 2007 18:54:21 +0000 (18:54 +0000)
posix/glob.c

index 6d8a891..6ae09ef 100644 (file)
@@ -454,9 +454,10 @@ glob (pattern, flags, errfunc, pglob)
          dirlen = 0;
        }
     }
-  else if (filename == pattern)
+  else if (filename == pattern
+          || (filename == pattern + 1 && pattern[0] == '\\'))
     {
-      /* "/pattern".  */
+      /* "/pattern" or "\\/pattern".  */
       dirname = "/";
       dirlen = 1;
       ++filename;