Wildcards not working with -X/-I
Hrvoje Niksic <[email protected]> Thu, 05 May 2005 17:21:06 +0200
| Newsgroups | gmane.comp.web.wget.patches |
|---|---|
| Message-ID | <[email protected]> |
Despite the documentation, wildcards don't work with -X/-I. For example, `wget -p www.apache.org -X/images' rejects images (as expected), but `wget -p www.apache.org -X/ima\?es' doesn't. This has been reported in 2002, but I must have somehow missed the patch, or forgot to apply it. 2005-05-05 Charles C.Fu <[email protected]> * utils.c (proclist): Strip leading slash when calling fnmatch too, otherwise wildcard comparisons always fail. Index: src/utils.c =================================================================== RCS file: /pack/anoncvs/wget/src/utils.c,v retrieving revision 1.97 diff -u -r1.97 utils.c --- src/utils.c 2005/05/05 14:47:48 1.97 +++ src/utils.c 2005/05/05 15:18:46 @@ -681,19 +681,21 @@ 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; }