diff options
author | hackademix | 2018-08-30 17:21:45 +0200 |
---|---|---|
committer | hackademix | 2018-08-30 17:21:45 +0200 |
commit | f18fa60109919b3650b6bd8b8ab322b5144291ce (patch) | |
tree | 26fd749a5bdfd3fe68611ec2548f0a930f2ef12b /TLD | |
parent | eb158d9fa3344203e041ab95fe2020a6b51a3584 (diff) | |
parent | a103af9154563210424ace39ab95da452c4e71ad (diff) | |
download | noscript-f18fa60109919b3650b6bd8b8ab322b5144291ce.tar.gz noscript-f18fa60109919b3650b6bd8b8ab322b5144291ce.tar.xz noscript-f18fa60109919b3650b6bd8b8ab322b5144291ce.zip |
Merge branch 'fix/tld'
Fixed breakage in tld.js generation when for any reason the source pubblic suffix list contains CRLF characters.
Diffstat (limited to 'TLD')
-rw-r--r-- | TLD/generate.pl | 6 |
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; } |