On Mon, May 2, 2011 at 4:22 PM, Jeff Trawick <[email protected]> wrote:
> this fails unexpectedly:
>
> res = apr_fnmatch("a?z", "a/z", 0);
> ABTS_INT_EQUAL(tc, 0, res);
same as the other one, I just got there with a different thought
Index: strings/apr_fnmatch.c
===================================================================
--- strings/apr_fnmatch.c (revision 1098590)
+++ strings/apr_fnmatch.c (working copy)
@@ -152,7 +152,7 @@
}
else if (**pattern == '?') {
/* Optimize '?' match before unescaping **pattern */
- if (!**string || (!slash || (**string != '/')))
+ if (!**string || (slash && (**string == '/')))
return APR_FNM_NOMATCH;
result = 0;
goto fnmatch_ch_success;
fail if end of string being tested
fail if we're trying to match a '/' but this is a pathname (wildcard
'?' can't match '/' in that case)