Formerly ../posix/fnmatch.c.~17~
authorroland <roland>
Wed, 18 Nov 1992 19:24:16 +0000 (19:24 +0000)
committerroland <roland>
Wed, 18 Nov 1992 19:24:16 +0000 (19:24 +0000)
posix/fnmatch.c

index 6926633..ed8c9ee 100644 (file)
@@ -165,5 +165,9 @@ fnmatch (pattern, string, flags)
   if (*n == '\0')
     return 0;
 
+  if ((flags & FNM_LEADING_DIR) && *n == '/')
+    /* The FNM_LEADING_DIR flag says that "foo*" matches "foobar/frobozz".  */
+    return 0;
+
   return FNM_NOMATCH;
 }