diff options
author | ot <ot@localhost> | 2005-06-20 08:11:44 +0000 |
---|---|---|
committer | ot <ot@localhost> | 2005-06-20 08:11:44 +0000 |
commit | 0423fc1ad41ec6708f3c77453760e922ee818aa3 (patch) | |
tree | e3c93b2aedad7217a4f511af28b82fc90dcf8a13 | |
parent | eccba9dda4c574c8ec3f6a80378238a495d6c461 (diff) | |
download | markup-validator-0423fc1ad41ec6708f3c77453760e922ee818aa3.zip markup-validator-0423fc1ad41ec6708f3c77453760e922ee818aa3.tar.gz markup-validator-0423fc1ad41ec6708f3c77453760e922ee818aa3.tar.bz2 |
Cleaning up a variable overload bug. A piece of (old) code trolls the ESIS
for version attributes, as a way, among other things, to see whether the parser
has used a fallback doctype. Keeping this functionality, but removing the part where
the (important File->{Version} would be overwritten.
See also:
http://lists.w3.org/Archives/Public/public-qa-dev/2005Jun/thread.html#3
-rwxr-xr-x | httpd/cgi-bin/check | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/httpd/cgi-bin/check b/httpd/cgi-bin/check index c8ffb68..aadefda 100755 --- a/httpd/cgi-bin/check +++ b/httpd/cgi-bin/check @@ -9,7 +9,7 @@ # This source code is available under the license at: # http://www.w3.org/Consortium/Legal/copyright-software # -# $Id: check,v 1.422 2005-06-03 05:03:28 ot Exp $ +# $Id: check,v 1.423 2005-06-20 08:11:44 ot Exp $ # # Disable buffering on STDOUT! @@ -220,7 +220,7 @@ Directory not readable (permission denied): @_r # # Strings - $VERSION = q$Revision: 1.422 $; + $VERSION = q$Revision: 1.423 $; $VERSION =~ s/Revision: ([\d\.]+) /$1/; # @@ -754,13 +754,12 @@ sub parse (\$) { for (@{$File->{ESIS}}) { no warnings 'uninitialized'; next unless /^AVERSION CDATA (.*)/i; + push @{$File->{Version_ESIS}}, $1; if ($1 =~ '-//W3C//DTD (SGML|XML) Fallback//EN') { $File->{Tentative} |= (T_ERROR | T_FALL); my $dtd = $1 eq 'SGML' ? 'HTML 4.01 Transitional' : 'XHTML 1.0 Strict'; &add_warning('W09', { W09_dtd => $dtd }); } - $File->{Version} = $1; - last; } return $File; @@ -816,8 +815,9 @@ if ($File->{Opt}->{Output} eq 'xml') { - if (! $File->{Doctype} and ($File->{Version} eq 'unknown' or $File->{Version} eq 'SGML')) { - $T->param(file_version => '(no Doctype found)'); + if (! $File->{Doctype} and ($File->{Version} eq 'unknown' or $File->{Version} eq 'SGML' or (!$File->{Version}))) { + # @@TODO@@ we should try falling back on other version info, such as the ones stored in Version_ESIS + $T->param(file_version => '(no Doctype found)'); } else { $T->param(file_version => $File->{Version}); |