From: Matthew Vernon Date: Tue, 15 Apr 2014 17:00:54 +0000 (+0100) Subject: Merge remote branch 'origin/master' X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~webstump/git?a=commitdiff_plain;h=1cb218f80055e4032bc11da318b8360872e1cfb9;hp=20f9131ed0735ec90769865f56e0079b94582c73;p=modbot-ulm.git Merge remote branch 'origin/master' --- diff --git a/webstump/scripts/html_output.pl b/webstump/scripts/html_output.pl index bf6707d..728bd71 100644 --- a/webstump/scripts/html_output.pl +++ b/webstump/scripts/html_output.pl @@ -635,22 +635,24 @@ sub scanlogs ($$$) { my $num= sub { local ($_) = @_; return $forwards * ( - m/^errs$/ ? -1 : - m/^errs\.(\d+)(?:\.gz$)$/ ? $1 : - undef + m/^errs$/ ? 1 : + m/^errs\.(\d+)(?:\.gz$)$/ ? ($1+2) : + 0 ); }; foreach my $leaf ( sort { $num->($a) <=> $num->($b) } - grep { defined $num->($_) } + grep { $num->($_) } readdir LOGSDIR ) { my $file= "$dir/$leaf"; - if ($file =~ m/\.gz$/) { - open LOGFILE, "zcat $file |" or die "zcat $file $!"; + if ($file =~ m/\/errs.*\.gz$/) { + open LOGFILE, "zcat $file | tac |" or die "zcat $file | tac $!"; + } elsif ($file =~ /errs/) { + open LOGFILE, "tac $file |" or die "tac $file $!"; } else { - open LOGFILE, "< $file" or die "$file $!"; - } + die "Unexpected filename in scanlogs: $file"; + } while () { my $tgot= $callback->(); next unless $tgot;