X-Git-Url: http://www.privoxy.org/gitweb/?p=privoxy.git;a=blobdiff_plain;f=tools%2Furl-pattern-translator.pl;h=0653e7676ac58c8d830e15f3148897bc3ee32e0e;hp=f159fb036a5329a907e16be757e594b5091c66a3;hb=540249459558fe9ae78dcaba162c362ba5263530;hpb=eef8c427a9b0cb95fef1b337da1e1feac0f7b05a diff --git a/tools/url-pattern-translator.pl b/tools/url-pattern-translator.pl index f159fb03..0653e767 100755 --- a/tools/url-pattern-translator.pl +++ b/tools/url-pattern-translator.pl @@ -18,8 +18,6 @@ # 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 $ -# # Copyright (c) 2008 Fabian Keil # # Permission to use, copy, modify, and distribute this software for any @@ -63,20 +61,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@((?