From 2f3c75c33ea8be300bdce0a30a1ebd269eb6b804 Mon Sep 17 00:00:00 2001 From: Amos Jeffries Date: Mon, 29 Jul 2013 18:44:04 -0600 Subject: [PATCH] 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. --- src/cache_cf.cc | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/cache_cf.cc b/src/cache_cf.cc index 82a7fe2363..521c9dd5f5 100644 --- a/src/cache_cf.cc +++ b/src/cache_cf.cc @@ -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; } -- 2.47.2