]> sjero.net Git - wget/commitdiff
[svn] Fix -X/-I with wildcards.
authorhniksic <devnull@localhost>
Thu, 5 May 2005 15:22:11 +0000 (08:22 -0700)
committerhniksic <devnull@localhost>
Thu, 5 May 2005 15:22:11 +0000 (08:22 -0700)
src/ChangeLog
src/utils.c

index 1f094d012f98acfbcc13dd61ffc466b11f8a56f9..7a3c70d1c74fc9b930383b6dc1567f93311a2793 100644 (file)
@@ -1,3 +1,8 @@
+2005-05-05  Charles C.Fu  <ccwf@bacchus.com>
+
+       * utils.c (proclist): Strip leading slash when calling fnmatch
+       too, otherwise wildcard comparisons always fail.
+
 2005-05-05  Hrvoje Niksic  <hniksic@xemacs.org>
 
        * utils.c (touch): Set access time to current time.
index e09a2355c7e1950274fa9ae4f76c3de200c01eaf..6fbeaa7fbc507a83b19ca900ab15945b2d3886d5 100644 (file)
@@ -681,19 +681,21 @@ static char *
 proclist (char **strlist, const char *s, enum accd flags)
 {
   char **x;
-
   for (x = strlist; *x; x++)
-    if (has_wildcards_p (*x))
-      {
-       if (fnmatch (*x, s, FNM_PATHNAME) == 0)
-         break;
-      }
-    else
-      {
-       char *p = *x + ((flags & ALLABS) && (**x == '/')); /* Remove '/' */
-       if (frontcmp (p, s))
-         break;
-      }
+    {
+      /* Remove leading '/' if ALLABS */
+      char *p = *x + ((flags & ALLABS) && (**x == '/'));
+      if (has_wildcards_p (p))
+       {
+         if (fnmatch (p, s, FNM_PATHNAME) == 0)
+           break;
+       }
+      else
+       {
+         if (frontcmp (p, s))
+           break;
+       }
+    }
   return *x;
 }