From: Amos Jeffries Date: Thu, 8 Aug 2013 06:03:04 +0000 (-0600) Subject: Fix debugs when refresh_pattern is missing the regex pattern X-Git-Tag: SQUID_3_4_0_2~41 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4448d32e0a3e4cb5a5ee6033f7bb46a13c73ac89;p=thirdparty%2Fsquid.git Fix debugs when refresh_pattern is missing the regex pattern 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. --- diff --git a/src/cache_cf.cc b/src/cache_cf.cc index 447f851563..199881afa7 100644 --- a/src/cache_cf.cc +++ b/src/cache_cf.cc @@ -2803,20 +2803,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; }