projects
/
usenet
/
newsstats.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Allow more characters in TLH definitions.
[usenet/newsstats.git]
/
gatherstats.pl
diff --git
a/gatherstats.pl
b/gatherstats.pl
index
b570cd8
..
0a5a9a2
100755
(executable)
--- a/
gatherstats.pl
+++ b/
gatherstats.pl
@@
-78,19
+78,25
@@
my $TLH;
if ($Conf{'TLH'}) {
# $Conf{'TLH'} is parsed as an array by Config::Auto;
# make a flat list again, separated by :
if ($Conf{'TLH'}) {
# $Conf{'TLH'} is parsed as an array by Config::Auto;
# make a flat list again, separated by :
- if (ref($
TLH
) eq 'ARRAY') {
+ if (ref($
Conf{'TLH'}
) eq 'ARRAY') {
$TLH = join(':',@{$Conf{'TLH'}});
} else {
$TLH = $Conf{'TLH'};
}
# strip whitespace
$TLH =~ s/\s//g;
$TLH = join(':',@{$Conf{'TLH'}});
} else {
$TLH = $Conf{'TLH'};
}
# strip whitespace
$TLH =~ s/\s//g;
+ # add trailing dots if none are present yet
+ # (using negative look-behind assertions)
+ $TLH =~ s/(?<!\.):/.:/g;
+ $TLH =~ s/(?<!\.)$/./;
# check for illegal characters
&Bleat(2,'Config error - illegal characters in TLH definition!')
# check for illegal characters
&Bleat(2,'Config error - illegal characters in TLH definition!')
- if ($TLH !~ /^[a-zA-Z0-9:]+$/);
+ if ($TLH !~ /^[a-zA-Z0-9:+.-]+$/);
+ # escape dots
+ $TLH =~ s/\./\\./g;
if ($TLH =~ /:/) {
# reformat $TLH from a:b to (a)|(b),
if ($TLH =~ /:/) {
# reformat $TLH from a:b to (a)|(b),
- # e.g. replace '
.' by '|
'
+ # e.g. replace '
:' by ')|(
'
$TLH =~ s/:/)|(/g;
$TLH = '(' . $TLH . ')';
};
$TLH =~ s/:/)|(/g;
$TLH = '(' . $TLH . ')';
};
This page took
0.010719 seconds
and
4
git commands to generate.