From: Ian Jackson Date: Mon, 9 Sep 2013 11:36:33 +0000 (+0100) Subject: fix regexp not to loop stupidly: X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ijackson/git?a=commitdiff_plain;h=ea225eac1b0e3d2b85e092b8ea457031efcd5ee4;p=rrd-graphs.git fix regexp not to loop stupidly: 1. the regexp was too loose and matched /in/ not just /\bin\b/. 2. chiark.peer.fu-berlin.de consists mostly of stopwords by this rule 3. A bug meant that when it got to the end, it didn't stop, but always ate the TLD as if it were a stopword. --- diff --git a/cgi b/cgi index b9acb94..968745e 100755 --- a/cgi +++ b/cgi @@ -203,7 +203,7 @@ foreach my $site (keys %news_sources) { my $sk= $site; for (;;) { last unless $sk =~ - s/^[^.]*(?:chiark|greenend|news|nntp|peer|feed|in|out)[^.]*\.//; + s/^[^. ]*\b(?:chiark|greenend|news|nntp|peer|feed|in|out)\b[^.]*\.//; $sk .= " $&"; } foreach my $inout (keys %{ $news_sources{$site} }) {