summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhackademix2018-08-29 18:21:24 +0200
committerhackademix2018-08-29 18:21:24 +0200
commita103af9154563210424ace39ab95da452c4e71ad (patch)
tree5afb542c0e1d1560f3a98481913e40f392397836
parentbe3ab16315b09ba008e7faa469ad295c409796a1 (diff)
downloadnoscript-a103af9154563210424ace39ab95da452c4e71ad.tar.gz
noscript-a103af9154563210424ace39ab95da452c4e71ad.tar.xz
noscript-a103af9154563210424ace39ab95da452c4e71ad.zip
Fixed public suffix parsing potentially broken by CRLF.
-rw-r--r--TLD/generate.pl6
1 files changed, 3 insertions, 3 deletions
diff --git a/TLD/generate.pl b/TLD/generate.pl
index 748f66d..e37ffd5 100644
--- a/TLD/generate.pl
+++ b/TLD/generate.pl
@@ -14,7 +14,7 @@ sub generate {
while(<DAT>) {
s/\./\\\./g;
s/\s+utf.*//;
- s/\n//;
+ s/[\r\n]//g;
if(/^!/) {
s/^!//;
push(@ex, lc($_));
@@ -42,8 +42,8 @@ sub generate {
open(SRC, $src) || die("Cannot open $src");
open(DST, ">$dst") || die("Cannot open $dst");
while(<SRC>) {
- s/(_tldRx:\s*\/\(.*?\))[\s\S]*?(\$\/)/$1$rx$2/g;
- s/(_tldEx:\s*\/\(.*?\))[\s\S]*?(\$\/)/$1$ex$2/g;
+ s/(_tldRx:\s*\/\(.*?\)).*?(?=\$\/)/$1$rx/s;
+ s/(_tldEx:\s*\/\(.*?\)).*?(?=\$\/)/$1$ex/s;
print DST;
print;
}