projects
/
privoxy.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
4652dac
)
Trailing dots in old-school domain patterns mean "(\..*)?", not "\..*".
author
Fabian Keil
<fk@fabiankeil.de>
Sun, 10 Aug 2008 16:35:47 +0000
(16:35 +0000)
committer
Fabian Keil
<fk@fabiankeil.de>
Sun, 10 Aug 2008 16:35:47 +0000
(16:35 +0000)
tools/url-pattern-translator.pl
patch
|
blob
|
history
diff --git
a/tools/url-pattern-translator.pl
b/tools/url-pattern-translator.pl
index
f159fb0
..
9dfa78f
100755
(executable)
--- 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.
#
# 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:4
9 fk Exp $
+# $Id: url-pattern-translator.pl 1.
10 2008/08/10 16:32:5
9 fk Exp $
#
# Copyright (c) 2008 Fabian Keil <fk@fabiankeil.de>
#
#
# Copyright (c) 2008 Fabian Keil <fk@fabiankeil.de>
#
@@
-65,18
+65,14
@@
sub convert_host_pattern ($) {
# Match-all syntax has changed ...
$hp =~ s@\*@.*@g;
# 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
# Literal dots have to be escaped
- $hp =~ s@(\.[^*])@\\$1@g;
+ $hp =~ s@(
(?<!\\)
\.[^*])@\\$1@g;
# Match single character with a dot.
# Match single character with a dot.
- $hp =~ s@\?@.@g;
-
- #p("converted $host_pattern to: $hp");
+ $hp =~ s@(?<!\))\?@.@g;
return $hp;
}
return $hp;
}