From: Amos Jeffries Date: Sat, 7 May 2011 05:56:29 +0000 (-0600) Subject: CacheMgr: display -i/+i in regex ACL config display X-Git-Tag: SQUID_3_1_12_2~19 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5f9e4376c9bc666c5ff90d81f27071eac10a72c4;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..85ae0e39fd 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 d329774863..e64a81a2ae 100644 --- a/src/cf.data.pre +++ b/src/cf.data.pre @@ -542,8 +542,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 49c950b9a2..945c88911e 100644 --- a/src/structs.h +++ b/src/structs.h @@ -110,6 +110,7 @@ struct ushortlist { }; struct relist { + int flags; char *pattern; regex_t regex; relist *next;