diff options
author | ville <ville@localhost> | 2009-06-26 20:51:50 +0000 |
---|---|---|
committer | ville <ville@localhost> | 2009-06-26 20:51:50 +0000 |
commit | 3f729cf40d40b4f669c8cbbd86a5056639ec70ed (patch) | |
tree | 2b17fe125679fa4a6743e647b399b471f613458e /httpd | |
parent | 75ae360ebe2da0a1d551b6736f0fc2235c6c1ab1 (diff) | |
download | markup-validator-3f729cf40d40b4f669c8cbbd86a5056639ec70ed.zip markup-validator-3f729cf40d40b4f669c8cbbd86a5056639ec70ed.tar.gz markup-validator-3f729cf40d40b4f669c8cbbd86a5056639ec70ed.tar.bz2 |
Avoid error log trashing from errors without a line number (such as some validator.nu info messages).
Diffstat (limited to 'httpd')
-rwxr-xr-x | httpd/cgi-bin/check | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/httpd/cgi-bin/check b/httpd/cgi-bin/check index 27b13d3..c1aa24c 100755 --- a/httpd/cgi-bin/check +++ b/httpd/cgi-bin/check @@ -14,7 +14,7 @@ # This source code is available under the license at: # http://www.w3.org/Consortium/Legal/copyright-software # -# $Id: check,v 1.659 2009-06-26 20:50:01 ville Exp $ +# $Id: check,v 1.660 2009-06-26 20:51:50 ville Exp $ # # Disable buffering on STDOUT! $| = 1; @@ -199,7 +199,7 @@ Directory not readable (permission denied): @_r # # Strings - $VERSION = q$Revision: 1.659 $; + $VERSION = q$Revision: 1.660 $; $VERSION =~ s/Revision: ([\d\.]+) /$1/; # @@ -2095,7 +2095,8 @@ sub report_errors ($) { foreach my $err (@{$File->{Errors}}) { my $line; my $col = 0; - if($File->{Content}->[$err->{line}-1]) { # avoid truncating lines that do not exist + # avoid truncating lines that do not exist + if (defined($err->{line}) && $File->{Content}->[$err->{line}-1]) { if (defined($err->{char}) && $err->{char} =~ /^[0-9]+$/ ){ ($line, $col) = &truncate_line($File->{Content}->[$err->{line}-1], $err->{char}); $line = &mark_error($line, $col); |