]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
CacheMgr: display -i/+i in regex ACL config display
authorAmos Jeffries <squid3@treenet.co.nz>
Fri, 6 May 2011 14:31:36 +0000 (02:31 +1200)
committerAmos Jeffries <squid3@treenet.co.nz>
Fri, 6 May 2011 14:31:36 +0000 (02:31 +1200)
src/acl/RegexData.cc
src/cf.data.pre
src/structs.h

index 03314eaea7bf1f1750ae90eda21ff1e3f34f5b55..b9eb942cc3acdd1ad52405e4f56a28dbfb1b8056 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 0920d4cbf86c6baaa85bed5737d88da9a984ced6..1fad47dffb8eca04f55cc9ba60ea9862193572cc 100644 (file)
@@ -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.
index 49cf40bf4336e9c3a75e73c836ee8435c5f50588..213b98d572cb20a9ae2d81b7c6ccd8a42ba3559a 100644 (file)
@@ -122,6 +122,7 @@ struct ushortlist {
 };
 
 struct relist {
+    int flags;
     char *pattern;
     regex_t regex;
     relist *next;