httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From n..@apache.org
Subject svn commit: r559999 - /httpd/httpd/trunk/modules/filters/mod_filter.c
Date Thu, 26 Jul 2007 21:41:44 GMT
Author: niq
Date: Thu Jul 26 14:41:43 2007
New Revision: 559999

URL: http://svn.apache.org/viewvc?view=rev&rev=559999
Log:
Rationalisation suggested by rpluem

Modified:
    httpd/httpd/trunk/modules/filters/mod_filter.c

Modified: httpd/httpd/trunk/modules/filters/mod_filter.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/filters/mod_filter.c?view=diff&rev=559999&r1=559998&r2=559999
==============================================================================
--- httpd/httpd/trunk/modules/filters/mod_filter.c (original)
+++ httpd/httpd/trunk/modules/filters/mod_filter.c Thu Jul 26 14:41:43 2007
@@ -201,23 +201,16 @@
             }
         }
         /* we can't check for NULL in provider as that kills integer 0
-	 * so we have to test each string/regexp case in the switch
-	 */
+         * so we have to test each string/regexp case in the switch
+         */
         else {
             switch (provider->match_type) {
             case STRING_MATCH:
-                if (!provider->match.string) {
-                    match = 0;
-                }
-		else if (strcasecmp(str, provider->match.string)) {
+                if (strcasecmp(str, provider->match.string)) {
                     match = 0;
                 }
                 break;
             case STRING_CONTAINS:
-                if (!provider->match.string) {
-                    match = 0;
-                    break;
-                }
                 str1 = apr_pstrdup(r->pool, str);
                 ap_str_tolower(str1);
                 if (!strstr(str1, provider->match.string)) {
@@ -225,11 +218,8 @@
                 }
                 break;
             case REGEX_MATCH:
-                if (!provider->match.string) {
-                    match = 0;
-                }
-		else if (ap_regexec(provider->match.regex, str, 0, NULL, 0)
-                         == AP_REG_NOMATCH) {
+                if (ap_regexec(provider->match.regex, str, 0, NULL, 0)
+                    == AP_REG_NOMATCH) {
                     match = 0;
                 }
                 break;
@@ -601,6 +591,9 @@
                                                          match,
                                                          rxend-match),
                                             flags);
+        if (provider->match.regex == NULL) {
+            return "Bad regexp";
+        }
         break;
     case '*':
         provider->match_type = DEFINED;



Mime
View raw message