From 6d2dd33af4c943a531fdf6d9e60a81be392fce52 Mon Sep 17 00:00:00 2001 From: wrowe Date: Wed, 18 May 2011 16:21:27 +0000 Subject: Backport legibility enhancement from r1103115 (an illegible patch, in its own right, due to an svn:eol-style mess on svn cp). git-svn-id: http://svn.apache.org/repos/asf/apr/apr/branches/1.5.x@1124317 13f79535-47bb-0310-9956-ffa450edef68 --- strings/apr_fnmatch.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'strings') diff --git a/strings/apr_fnmatch.c b/strings/apr_fnmatch.c index 1773105d4..0b00846e5 100644 --- a/strings/apr_fnmatch.c +++ b/strings/apr_fnmatch.c @@ -118,8 +118,8 @@ static APR_INLINE int fnmatch_ch(const char **pattern, const char **string, int leadingclosebrace: /* Look at only well-formed range patterns; * "x-]" is not allowed unless escaped ("x-\]") + * XXX: Fix for locale/MBCS character width */ - /* XXX: Fix for locale/MBCS character width */ if (((*pattern)[1] == '-') && ((*pattern)[2] != ']')) { startch = *pattern; @@ -370,12 +370,12 @@ APR_DECLARE(int) apr_fnmatch(const char *pattern, const char *string, int flags) } } - if (*string && (!slash || (*string != '/'))) + if (*string && !(slash && (*string == '/'))) return APR_FNM_NOMATCH; - if (*pattern && (!slash || ((*pattern != '/') - && (!escape || (*pattern != '\\') - || (pattern[1] != '/'))))) + if (*pattern && !(slash && ((*pattern == '/') + || (escape && (*pattern == '\\') + && (pattern[1] == '/'))))) return APR_FNM_NOMATCH; } -- cgit v1.2.1