]>
Commit | Line | Data |
---|---|---|
87a0444f | 1 | diff -ur apr-1.4.4-orig/strings/apr_fnmatch.c apr-1.4.4/strings/apr_fnmatch.c |
2 | --- apr-1.4.4-orig/strings/apr_fnmatch.c 2011-05-03 06:51:24.000000000 +0200 | |
3 | +++ apr-1.4.4/strings/apr_fnmatch.c 2011-05-19 20:50:52.042450131 +0200 | |
4 | @@ -196,8 +196,11 @@ | |
5 | const char *mismatch = NULL; | |
6 | int matchlen = 0; | |
7 | ||
8 | - while (*pattern) | |
9 | - { | |
10 | + if (*pattern == '*') | |
11 | + goto firstsegment; | |
12 | + | |
13 | + while (*pattern && *string) | |
14 | + { | |
15 | /* Match balanced slashes, starting a new segment pattern | |
16 | */ | |
17 | if (slash && escape && (*pattern == '\\') && (pattern[1] == '/')) | |
18 | @@ -207,6 +210,7 @@ | |
19 | ++string; | |
20 | } | |
21 | ||
22 | +firstsegment: | |
23 | /* At the beginning of each segment, validate leading period behavior. | |
24 | */ | |
25 | if ((flags & APR_FNM_PERIOD) && (*string == '.')) | |
26 | @@ -361,9 +365,9 @@ | |
27 | return APR_FNM_NOMATCH; | |
28 | } | |
29 | ||
30 | - /* pattern is at EOS; if string is also, declare success | |
31 | + /* Where both pattern and string are at EOS, declare success | |
32 | */ | |
33 | - if (!*string) | |
34 | + if (!*string && !*pattern) | |
35 | return 0; | |
36 | ||
37 | /* pattern didn't match to the end of string */ | |
38 | Tylko w apr-1.4.4/strings: apr_fnmatch.c~ |