summaryrefslogtreecommitdiffstats
path: root/httpd/cgi-bin/check
diff options
context:
space:
mode:
authorville <ville@localhost>2009-10-05 19:49:45 +0000
committerville <ville@localhost>2009-10-05 19:49:45 +0000
commit56e1e1d3362f5896e7720584767029b06c021e4b (patch)
treec76802ac5d900afa8cebb5c59fd6c6e9e7c18b96 /httpd/cgi-bin/check
parent15c63c2279916669cbd0c06263a01b1066c96de2 (diff)
downloadmarkup-validator-56e1e1d3362f5896e7720584767029b06c021e4b.zip
markup-validator-56e1e1d3362f5896e7720584767029b06c021e4b.tar.gz
markup-validator-56e1e1d3362f5896e7720584767029b06c021e4b.tar.bz2
Avoid (some) error log trashing with empty documents.
Diffstat (limited to 'httpd/cgi-bin/check')
-rwxr-xr-xhttpd/cgi-bin/check8
1 files changed, 4 insertions, 4 deletions
diff --git a/httpd/cgi-bin/check b/httpd/cgi-bin/check
index c46f10d..289d798 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.709 2009-10-05 15:13:58 ville Exp $
+# $Id: check,v 1.710 2009-10-05 19:49:45 ville Exp $
#
# Disable buffering on STDOUT!
$| = 1;
@@ -208,7 +208,7 @@ Directory not readable (permission denied): @_r
#
# Strings
- $VERSION = q$Revision: 1.709 $;
+ $VERSION = q$Revision: 1.710 $;
$VERSION =~ s/Revision: ([\d\.]+) /$1/;
#
@@ -2216,8 +2216,8 @@ sub source {
my $File = shift;
# Remove any BOM since we're not at BOT anymore...
- $File->{Content}->[0] =
- substr $File->{Content}->[0], ($File->{BOM} ? 1 : 0); # remove BOM
+ $File->{Content}->[0] = substr($File->{Content}->[0], 1)
+ if ($File->{BOM} && scalar(@{$File->{Content}}));
my @source = map({file_source_line => $_}, @{$File->{Content}});
return \@source;