From: Yang Tse Date: Thu, 5 Apr 2007 00:14:27 +0000 (+0000) Subject: Further improve displaying of individual logfiles X-Git-Tag: curl-7_16_2~26 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=70f9a13ecba74a1e59e7f563706efce369261ec0;p=thirdparty%2Fcurl.git Further improve displaying of individual logfiles --- diff --git a/tests/runtests.pl b/tests/runtests.pl index a6ba2012cd..f365beaf88 100755 --- a/tests/runtests.pl +++ b/tests/runtests.pl @@ -2426,10 +2426,23 @@ open(CMDLOG, ">$CURLLOG") || sub displaylogcontent { my ($file)=@_; if(open(my $SINGLE, "<$file")) { - while(my $line = <$SINGLE>) { - chomp $line; - $line =~ s/\s*\!$//; - logmsg " $line\n"; + my $lfcount; + while(my $string = <$SINGLE>) { + $string =~ s/\r\n/\n/g; + $string =~ s/[\r\f\032]/\n/g; + $string .= "\n" unless ($string =~ /\n$/); + $lfcount = $string =~ tr/\n//; + if($lfcount == 1) { + $string =~ s/\n//; + $string =~ s/\s*\!$//; + logmsg " $string\n"; + } + else { + for my $line (split("\n", $string)) { + $line =~ s/\s*\!$//; + logmsg " $line\n"; + } + } } close($SINGLE); }