Oh well, rename the --enable-pcre-host-patterns option to
[privoxy.git] / urlmatch.c
index 54089a7..871f2f1 100644 (file)
@@ -1,4 +1,4 @@
-const char urlmatch_rcs[] = "$Id: urlmatch.c,v 1.23 2008/04/05 12:19:20 fabiankeil Exp $";
+const char urlmatch_rcs[] = "$Id: urlmatch.c,v 1.24 2008/04/06 14:54:26 fabiankeil Exp $";
 /*********************************************************************
  *
  * File        :  $Source: /cvsroot/ijbswa/current/urlmatch.c,v $
@@ -33,6 +33,10 @@ const char urlmatch_rcs[] = "$Id: urlmatch.c,v 1.23 2008/04/05 12:19:20 fabianke
  *
  * Revisions   :
  *    $Log: urlmatch.c,v $
+ *    Revision 1.24  2008/04/06 14:54:26  fabiankeil
+ *    Use PCRE syntax in host patterns when configured
+ *    with --enable-pcre-host-patterns.
+ *
  *    Revision 1.23  2008/04/05 12:19:20  fabiankeil
  *    Factor compile_host_pattern() out of create_url_spec().
  *
@@ -635,7 +639,7 @@ jb_err parse_http_request(const char *req,
 }
 
 
-#ifdef FEATURE_PCRE_HOST_PATTERNS
+#ifdef FEATURE_EXTENDED_HOST_PATTERNS
 /*********************************************************************
  *
  * Function    :  compile_host_pattern
@@ -907,7 +911,7 @@ static int domain_match(const struct url_spec *pattern, const struct http_reques
    }
 
 }
-#endif /* def FEATURE_PCRE_HOST_PATTERNS */
+#endif /* def FEATURE_EXTENDED_HOST_PATTERNS */
 
 
 /*********************************************************************
@@ -1081,7 +1085,7 @@ void free_url_spec(struct url_spec *url)
    if (url == NULL) return;
 
    freez(url->spec);
-#ifdef FEATURE_PCRE_HOST_PATTERNS
+#ifdef FEATURE_EXTENDED_HOST_PATTERNS
    if (url->host_regex)
    {
       regfree(url->host_regex);
@@ -1090,7 +1094,7 @@ void free_url_spec(struct url_spec *url)
 #else
    freez(url->dbuffer);
    freez(url->dvec);
-#endif /* ndef FEATURE_PCRE_HOST_PATTERNS */
+#endif /* ndef FEATURE_EXTENDED_HOST_PATTERNS */
    freez(url->path);
    freez(url->port_list);
    if (url->preg)
@@ -1124,7 +1128,7 @@ int url_match(const struct url_spec *pattern,
 {
    /* XXX: these should probably be functions. */
 #define PORT_MATCHES ((NULL == pattern->port_list) || match_portlist(pattern->port_list, url->port))
-#ifdef FEATURE_PCRE_HOST_PATTERNS
+#ifdef FEATURE_EXTENDED_HOST_PATTERNS
 #define DOMAIN_MATCHES ((NULL == pattern->host_regex) || (0 == regexec(pattern->host_regex, url->host, 0, NULL, 0)))
 #else
 #define DOMAIN_MATCHES ((NULL == pattern->dbuffer) || (0 == domain_match(pattern, url)))