From: Fabian Keil <fk@fabiankeil.de>
Date: Sat, 9 Sep 2006 14:01:45 +0000 (+0000)
Subject: Integrated Oliver Yeoh's domain pattern fix
X-Git-Tag: v_3_0_5~57
X-Git-Url: http://www.privoxy.org/gitweb/@default-cgi@/faq/%22https:/developer-manual/static/@default-cgi@edit-actions-remove-url?a=commitdiff_plain;h=730da5d840d9572b9c0a5b8d90a2e1beebaa0adc;p=privoxy.git

Integrated Oliver Yeoh's domain pattern fix
to make sure *x matches xx. Closes Patch 1217393
and Bug 1170767.
---

diff --git a/miscutil.c b/miscutil.c
index 1e40c986..53958a25 100644
--- a/miscutil.c
+++ b/miscutil.c
@@ -1,4 +1,4 @@
-const char miscutil_rcs[] = "$Id: miscutil.c,v 1.40 2006/08/17 17:15:10 fabiankeil Exp $";
+const char miscutil_rcs[] = "$Id: miscutil.c,v 1.41 2006/08/18 16:03:17 david__schmidt Exp $";
 /*********************************************************************
  *
  * File        :  $Source: /cvsroot/ijbswa/current/miscutil.c,v $
@@ -36,6 +36,9 @@ const char miscutil_rcs[] = "$Id: miscutil.c,v 1.40 2006/08/17 17:15:10 fabianke
  *
  * Revisions   :
  *    $Log: miscutil.c,v $
+ *    Revision 1.41  2006/08/18 16:03:17  david__schmidt
+ *    Tweak for OS/2 build happiness.
+ *
  *    Revision 1.40  2006/08/17 17:15:10  fabiankeil
  *    - Back to timegm() using GnuPG's replacement if necessary.
  *      Using mktime() and localtime() could add a on hour offset if
@@ -877,10 +880,21 @@ int simplematch(char *pattern, char *text)
       }
       else if (pat != fallback)
       {
+         /*
+          * Increment text pointer if in char range matching
+          */
+         if (*pat == ']')
+         {
+            txt++;
+         }
          /*
           * Wildcard mode && nonmatch beyond fallback: Rewind pattern
           */
          pat = fallback;
+         /*
+          * Restart matching from current text pointer
+          */
+         continue;
       }
       txt++;
    }