summaryrefslogtreecommitdiff
path: root/strings
diff options
context:
space:
mode:
authorWilliam A. Rowe Jr <wrowe@apache.org>2011-05-02 21:49:55 +0000
committerWilliam A. Rowe Jr <wrowe@apache.org>2011-05-02 21:49:55 +0000
commit3f3a7a5557a34acebc8d301f1b502241f22dbf93 (patch)
tree129d2636b47a7725418251cfc5b8b8457497d21a /strings
parent641986af866ed8e1e7cf6b68fc9b11814c8ad2d6 (diff)
downloadapr-3f3a7a5557a34acebc8d301f1b502241f22dbf93.tar.gz
Resolve issue identified by Jeff Trawick; '*?' was handled
correctly, while 'x?' was not. Resolves one alert, assignment within conditional expression, for pedantic compilers. Forward ports: r1098799 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/branches/1.5.x@1098804 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'strings')
-rw-r--r--strings/apr_fnmatch.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/strings/apr_fnmatch.c b/strings/apr_fnmatch.c
index 1de725189..2f8108e4c 100644
--- a/strings/apr_fnmatch.c
+++ b/strings/apr_fnmatch.c
@@ -152,7 +152,7 @@ static __inline int fnmatch_ch(const char **pattern, const char **string, int fl
}
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;
@@ -225,7 +225,8 @@ APR_DECLARE(int) apr_fnmatch(const char *pattern, const char *string, int flags)
* Presumes '/' character is unique, not composite in any MBCS encoding
*/
if (slash) {
- if (!(strendseg = strchr(string, '/')))
+ strendseg = strchr(string, '/');
+ if (!strendseg)
strendseg = strchr(string, '\0');
}
else {