summaryrefslogtreecommitdiff
path: root/devel/apr/patches/patch-aa
diff options
context:
space:
mode:
Diffstat (limited to 'devel/apr/patches/patch-aa')
-rw-r--r--devel/apr/patches/patch-aa36
1 files changed, 36 insertions, 0 deletions
diff --git a/devel/apr/patches/patch-aa b/devel/apr/patches/patch-aa
new file mode 100644
index 00000000000..48a8f662349
--- /dev/null
+++ b/devel/apr/patches/patch-aa
@@ -0,0 +1,36 @@
+$NetBSD: patch-aa,v 1.5.2.2 2011/05/21 09:02:08 tron Exp $
+
+--- strings/apr_fnmatch.c.orig 2011-05-03 04:51:24.000000000 +0000
++++ strings/apr_fnmatch.c
+@@ -196,7 +196,10 @@ APR_DECLARE(int) apr_fnmatch(const char
+ 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 @@ APR_DECLARE(int) apr_fnmatch(const char
+ ++string;
+ }
+
++firstsegment:
+ /* At the beginning of each segment, validate leading period behavior.
+ */
+ if ((flags & APR_FNM_PERIOD) && (*string == '.'))
+@@ -361,9 +365,9 @@ APR_DECLARE(int) apr_fnmatch(const char
+ 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 */