apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "William A. Rowe Jr." <wr...@rowe-clan.net>
Subject Re: apr_fnmatch deltas
Date Mon, 02 May 2011 21:47:55 GMT
On 5/2/2011 5:18 PM, Jeff Trawick wrote:
> 
> 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)

Yup - that was where I went astray, I had moved typical '?'
processing into fnmatch_ch and constructed the test incorrectly
for its new context.  Glad we arrived at the same fix!

I fixed the one nested assignment alert, all that remains is the
'conditional expression is constant' out of the "for (; 1;)" loop
with no apparent fix.

Mime
View raw message