summaryrefslogtreecommitdiffstats
path: root/httpd
diff options
context:
space:
mode:
authorville <ville@localhost>2009-06-26 20:51:50 +0000
committerville <ville@localhost>2009-06-26 20:51:50 +0000
commit3f729cf40d40b4f669c8cbbd86a5056639ec70ed (patch)
tree2b17fe125679fa4a6743e647b399b471f613458e /httpd
parent75ae360ebe2da0a1d551b6736f0fc2235c6c1ab1 (diff)
downloadmarkup-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-xhttpd/cgi-bin/check7
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);