]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
CacheMgr: display -i/+i in regex ACL config display
authorAmos Jeffries <squid3@treenet.co.nz>
Sat, 7 May 2011 05:56:29 +0000 (23:56 -0600)
committerAmos Jeffries <squid3@treenet.co.nz>
Sat, 7 May 2011 05:56:29 +0000 (23:56 -0600)
src/acl/RegexData.cc
src/cf.data.pre
src/structs.h

index 03314eaea7bf1f1750ae90eda21ff1e3f34f5b55..85ae0e39fd3a6cd102fe6fd77db926ed677be2da 100644 (file)
@@ -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&REG_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;
index d329774863ead62762c987445c0df2f8a8122850..e64a81a2ae062de304c963b9eb863858c3bfdefc 100644 (file)
@@ -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.
index 49c950b9a2c7e09b276bccb5ef45e0bc914c79ec..945c88911e5d67a17725844e64640fe73520218b 100644 (file)
@@ -110,6 +110,7 @@ struct ushortlist {
 };
 
 struct relist {
+    int flags;
     char *pattern;
     regex_t regex;
     relist *next;