X-Git-Url: http://www.privoxy.org/gitweb/?a=blobdiff_plain;f=tools%2Furl-pattern-translator.pl;h=ae745cf2621aff7651244f99c05d494a0b2fc3d8;hb=b9caf4a4a3d9597c7c1bceb82f7d6d18970fa968;hp=f159fb036a5329a907e16be757e594b5091c66a3;hpb=eef8c427a9b0cb95fef1b337da1e1feac0f7b05a;p=privoxy.git diff --git a/tools/url-pattern-translator.pl b/tools/url-pattern-translator.pl index f159fb03..ae745cf2 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,v 1.3 2009/01/13 17:01:04 fabiankeil Exp $ # # Copyright (c) 2008 Fabian Keil # @@ -63,20 +63,16 @@ sub convert_host_pattern ($) { } # Match-all syntax has changed ... - $hp =~ s@\*@.*@g; + $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@((?