]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Fix debugs when refresh_pattern is missing the regex pattern
authorAmos Jeffries <squid3@treenet.co.nz>
Tue, 30 Jul 2013 00:44:04 +0000 (18:44 -0600)
committerAmos Jeffries <squid3@treenet.co.nz>
Tue, 30 Jul 2013 00:44:04 +0000 (18:44 -0600)
This is a very rare situation and may not be completely required. But it
did hinder debugging of refresh_pattern when the regex field token was
broken by parser updates.

src/cache_cf.cc

index 82a7fe2363609a932a8295ef59db67df1af1dd8b..521c9dd5f596cb6b949d973532503c2656b99ab0 100644 (file)
@@ -2804,20 +2804,20 @@ parse_refreshpattern(RefreshPattern ** head)
     int errcode;
     int flags = REG_EXTENDED | REG_NOSUB;
 
-    if ((token = ConfigParser::NextToken()) == NULL) {
-        self_destruct();
-        return;
-    }
+    if ((token = ConfigParser::NextToken()) != NULL) {
+
+        if (strcmp(token, "-i") == 0) {
+            flags |= REG_ICASE;
+            token = ConfigParser::NextToken();
+        } else if (strcmp(token, "+i") == 0) {
+            flags &= ~REG_ICASE;
+            token = ConfigParser::NextToken();
+        }
 
-    if (strcmp(token, "-i") == 0) {
-        flags |= REG_ICASE;
-        token = ConfigParser::NextToken();
-    } else if (strcmp(token, "+i") == 0) {
-        flags &= ~REG_ICASE;
-        token = ConfigParser::NextToken();
     }
 
     if (token == NULL) {
+        debugs(3, DBG_CRITICAL, "FATAL: refresh_pattern missing the regex pattern parameter");
         self_destruct();
         return;
     }