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; }