validator/httpd/cgi-bin check,1.709,1.710

Update of /sources/public/validator/httpd/cgi-bin
In directory hutz:/tmp/cvs-serv2113

Modified Files:
	check 
Log Message:
Avoid (some) error log trashing with empty documents.

Index: check
===================================================================
RCS file: /sources/public/validator/httpd/cgi-bin/check,v
retrieving revision 1.709
retrieving revision 1.710
diff -u -d -r1.709 -r1.710
--- check	5 Oct 2009 15:13:58 -0000	1.709
+++ check	5 Oct 2009 19:49:45 -0000	1.710
@@ -2216,8 +2216,8 @@
   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;

Received on Monday, 5 October 2009 19:49:51 UTC