From: Fabian Keil Date: Sun, 10 Aug 2008 16:35:47 +0000 (+0000) Subject: Trailing dots in old-school domain patterns mean "(\..*)?", not "\..*". X-Git-Tag: v_3_0_10~25 X-Git-Url: http://www.privoxy.org/gitweb/?p=privoxy.git;a=commitdiff_plain;h=96a70945adcf3e57b9b9475f8e6da48d5d325d6f;hp=4652dac338ef61b18927c179eafbefcb182839e9 Trailing dots in old-school domain patterns mean "(\..*)?", not "\..*". --- diff --git a/tools/url-pattern-translator.pl b/tools/url-pattern-translator.pl index f159fb03..9dfa78f2 100755 --- a/tools/url-pattern-translator.pl +++ b/tools/url-pattern-translator.pl @@ -18,7 +18,7 @@ # Only convert your files once, or, as RoboCop used to say, # there will be... trouble. # -# $Id: url-pattern-translator.pl 1.9 2008/04/06 16:01:49 fk Exp $ +# $Id: url-pattern-translator.pl 1.10 2008/08/10 16:32:59 fk Exp $ # # Copyright (c) 2008 Fabian Keil # @@ -65,18 +65,14 @@ sub convert_host_pattern ($) { # Match-all syntax has changed ... $hp =~ s@\*@.*@g; - if ($hp =~ m@\.$@) { - # Extended host patterns are right-anchored by default - $hp = $hp . '.*'; - } + # Extended host patterns are right-anchored by default + $hp =~ s@\.$@(\..*)?@; # Literal dots have to be escaped - $hp =~ s@(\.[^*])@\\$1@g; + $hp =~ s@((?