X-Git-Url: http://www.privoxy.org/gitweb/?a=blobdiff_plain;f=tools%2Furl-pattern-translator.pl;h=9dfa78f2ce2a91ec00d19422d3c62379e6ad550f;hb=1284f78d7c4454f212d1283695d76d78e23d6b4f;hp=f159fb036a5329a907e16be757e594b5091c66a3;hpb=eef8c427a9b0cb95fef1b337da1e1feac0f7b05a;p=privoxy.git 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@((?