--- srclib\apr\strings\apr_fnmatch.orig Mon May 02 23:51:24 2011 +++ srclib\apr\strings\apr_fnmatch.c Wed May 18 13:09:52 2011 @@ -196,7 +196,10 @@ const char *mismatch = NULL; int matchlen = 0; - while (*pattern) + if (*pattern == '*') + goto firstsegment; + + while (*pattern && *string) { /* Match balanced slashes, starting a new segment pattern */ @@ -207,6 +210,7 @@ ++string; } +firstsegment: /* At the beginning of each segment, validate leading period behavior. */ if ((flags & APR_FNM_PERIOD) && (*string == '.')) @@ -361,9 +365,9 @@ return APR_FNM_NOMATCH; } - /* pattern is at EOS; if string is also, declare success + /* Where both pattern and string are at EOS, declare success */ - if (!*string) + if (!*string && !*pattern) return 0; /* pattern didn't match to the end of string */