From ea225eac1b0e3d2b85e092b8ea457031efcd5ee4 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Mon, 9 Sep 2013 12:36:33 +0100 Subject: [PATCH] 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. --- cgi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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} }) { -- 2.30.2