From: Amos Jeffries Date: Fri, 6 May 2011 14:31:36 +0000 (+1200) Subject: CacheMgr: display -i/+i in regex ACL config display X-Git-Tag: take07~16^2~33 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=ae315d9cf654c284ff53f4b6ed35bf0fc7461536;p=thirdparty%2Fsquid.git CacheMgr: display -i/+i in regex ACL config display --- diff --git a/src/acl/RegexData.cc b/src/acl/RegexData.cc index 03314eaea7..b9eb942cc3 100644 --- a/src/acl/RegexData.cc +++ b/src/acl/RegexData.cc @@ -104,8 +104,18 @@ ACLRegexData::dump() { wordlist *W = NULL; relist *temp = data; + int flags = REG_EXTENDED | REG_NOSUB; while (temp != NULL) { + if (temp->flags != flags) { + if (temp->flags®_ICASE != 0) { + wordlistAdd(&W, "-i"); + } else { + wordlistAdd(&W, "+i"); + } + flags = temp->flags; + } + wordlistAdd(&W, temp->pattern); temp = temp->next; } @@ -145,6 +155,7 @@ aclParseRegexList(relist **curlist) } q = (relist *)memAllocate(MEM_RELIST); + q->flags = flags; q->pattern = xstrdup(t); q->regex = comp; *(Tail) = q; diff --git a/src/cf.data.pre b/src/cf.data.pre index 0920d4cbf8..1fad47dffb 100644 --- a/src/cf.data.pre +++ b/src/cf.data.pre @@ -644,8 +644,9 @@ DOC_START When using "file", the file should contain one item per line. - By default, regular expressions are CASE-SENSITIVE. To make - them case-insensitive, use the -i option. + By default, regular expressions are CASE-SENSITIVE. + To make them case-insensitive, use the -i option. To return case-sensitive + use the +i option between patterns, or make a new ACL line without -i. Some acl types require suspending the current request in order to access some external data source. diff --git a/src/structs.h b/src/structs.h index 49cf40bf43..213b98d572 100644 --- a/src/structs.h +++ b/src/structs.h @@ -122,6 +122,7 @@ struct ushortlist { }; struct relist { + int flags; char *pattern; regex_t regex; relist *next;