validator/httpd/cgi-bin check,1.505,1.506

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

Modified Files:
	check 
Log Message:
Warning cleanups.

Index: check
===================================================================
RCS file: /sources/public/validator/httpd/cgi-bin/check,v
retrieving revision 1.505
retrieving revision 1.506
diff -u -d -r1.505 -r1.506
--- check	27 Apr 2007 20:20:33 -0000	1.505
+++ check	27 Apr 2007 20:26:27 -0000	1.506
@@ -662,7 +662,7 @@
       if ($msg_line =~ /(.+)\^/){
         $xmlwf_error_col = length($1);
       }
-      if ($xmlwf_error_col == 79){
+      if (defined($xmlwf_error_col) && $xmlwf_error_col == 79){
         # working around an apparent odd limitation of libxml
         # which only gives context for lines up to 80 chars
         # http://www.w3.org/Bugs/Public/show_bug.cgi?id=4420
@@ -862,7 +862,7 @@
   $File->{'Tidy_OK'} = FALSE;
 }
 
-if ($File->{'Tidy_OK'} eq FALSE) {
+if (!$File->{'Tidy_OK'}) {
   # if tidy not available, disable
   $File->{Opt}->{'Show Tidy'} = FALSE;
 }
@@ -893,7 +893,7 @@
 }
 
 &prep_template($File, $template);
-fin_template($File, $template);
+&fin_template($File, $template);
 
 $template->param(file_warnings => $File->{Warnings});
 $template->param(tidy_output => $File->{'Tidy'});
@@ -1308,7 +1308,7 @@
   $File->{'Direct Input'} = TRUE;
   $File->{Charset}->{HTTP} = "utf-8"; # by default, the form accepts utf-8 chars
 
-  if ($File->{Opt}->{'Prefill'} eq TRUE ) {
+  if ($File->{Opt}->{'Prefill'}) {
     # we surround the HTML fragment with some basic document structure
     my $prefill_Template = undef;
     if ($File->{Opt}->{'Prefill Doctype'} eq 'html401') {
@@ -1521,9 +1521,9 @@
         $col = 80 if ($col > 80);
         ($line, $col) = &truncate_line($File->{Content}->[$err->{line}-1], $col);
         $line = &ent($line) . "…";
-        $col = "";
+        $col = 0;
       }
-      my $explanation;
+      my $explanation = "";
       if ($err->{num}) {
         my $num = $err->{num};
 
@@ -2232,7 +2232,7 @@
 {
   my ($self, $element) = @_;
   if ($element->{Name} =~ /^h([1-6])$/i) {
-
+    $self->{_file}->{heading_outline} ||= "";
     $self->{_file}->{heading_outline} .=
       "    " x int($1) . "[$element->{Name}] ";
     $self->{am_in_heading} = 1;
@@ -2270,8 +2270,7 @@
   my $doctype = $self->{_file}->{DOCTYPE};
 
   if (($element->{Name} eq $CFG->{Types}->{$doctype}->{Name})
-  and !$has_xmlns
-  and ($CFG->{Types}->{$doctype}->{"Namespace Required"} eq TRUE)) {
+  and !$has_xmlns and ($CFG->{Types}->{$doctype}->{"Namespace Required"})) {
     # whine if the root xmlns attribute is noted as required by spec, but not present
     my $err;
     my $location = $self->{_parser}->get_location();

Received on Friday, 27 April 2007 20:26:31 UTC