apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeff Trawick <traw...@gmail.com>
Subject Re: apr_fnmatch deltas
Date Mon, 02 May 2011 21:18:48 GMT
On Mon, May 2, 2011 at 4:22 PM, Jeff Trawick <trawick@gmail.com> 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)

Mime
View raw message