X-Git-Url: http://www.privoxy.org/gitweb/?p=privoxy.git;a=blobdiff_plain;f=tools%2Furl-pattern-translator.pl;h=5477a87600abacfcdfd781eec8f3af79f1b1bbf7;hp=f159fb036a5329a907e16be757e594b5091c66a3;hb=23445442f4bf0aa0bcf6e35df09daf8ef0d69d99;hpb=eef8c427a9b0cb95fef1b337da1e1feac0f7b05a diff --git a/tools/url-pattern-translator.pl b/tools/url-pattern-translator.pl index f159fb03..5477a876 100755 --- a/tools/url-pattern-translator.pl +++ b/tools/url-pattern-translator.pl @@ -15,11 +15,6 @@ # # url-pattern-translator.pl old.action > new.action # -# 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 +58,19 @@ 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@((?