From: hniksic Date: Thu, 5 May 2005 15:22:11 +0000 (-0700) Subject: [svn] Fix -X/-I with wildcards. X-Git-Tag: v1.13~1097 X-Git-Url: http://sjero.net/git/?p=wget;a=commitdiff_plain;h=30b7d608055cfae77749d5eaa75b1d12558190d7 [svn] Fix -X/-I with wildcards. --- diff --git a/src/ChangeLog b/src/ChangeLog index 1f094d01..7a3c70d1 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2005-05-05 Charles C.Fu + + * utils.c (proclist): Strip leading slash when calling fnmatch + too, otherwise wildcard comparisons always fail. + 2005-05-05 Hrvoje Niksic * utils.c (touch): Set access time to current time. diff --git a/src/utils.c b/src/utils.c index e09a2355..6fbeaa7f 100644 --- a/src/utils.c +++ b/src/utils.c @@ -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; }