apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wr...@apache.org
Subject svn commit: r1098804 - /apr/apr/branches/1.5.x/strings/apr_fnmatch.c
Date Mon, 02 May 2011 21:49:55 GMT
Author: wrowe
Date: Mon May  2 21:49:55 2011
New Revision: 1098804

URL: http://svn.apache.org/viewvc?rev=1098804&view=rev
Log:
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

Modified:
    apr/apr/branches/1.5.x/strings/apr_fnmatch.c

Modified: apr/apr/branches/1.5.x/strings/apr_fnmatch.c
URL: http://svn.apache.org/viewvc/apr/apr/branches/1.5.x/strings/apr_fnmatch.c?rev=1098804&r1=1098803&r2=1098804&view=diff
==============================================================================
--- apr/apr/branches/1.5.x/strings/apr_fnmatch.c (original)
+++ apr/apr/branches/1.5.x/strings/apr_fnmatch.c Mon May  2 21:49:55 2011
@@ -152,7 +152,7 @@ static __inline int fnmatch_ch(const cha
     }
     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 
          * 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 {



Mime
View raw message