summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorville <ville@localhost>2009-12-14 22:19:09 +0000
committerville <ville@localhost>2009-12-14 22:19:09 +0000
commitcb66a225ba33adac2b41ed91b9ef14ca2ca573e8 (patch)
tree204bba691a3cd7e9432df9c666400b37151ba3e4
parent7cd7b7293fd62a5b4b74cb45c7d4c8cc500f273a (diff)
downloadmarkup-validator-cb66a225ba33adac2b41ed91b9ef14ca2ca573e8.zip
markup-validator-cb66a225ba33adac2b41ed91b9ef14ca2ca573e8.tar.gz
markup-validator-cb66a225ba33adac2b41ed91b9ef14ca2ca573e8.tar.bz2
Don't lose XML::LibXML errors in "structured error" mode.
$err->_prev() was called one time too many per iteration while traversing the chain.
-rwxr-xr-xhttpd/cgi-bin/check17
1 files changed, 7 insertions, 10 deletions
diff --git a/httpd/cgi-bin/check b/httpd/cgi-bin/check
index 6e7d54e..eee19fb 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.755 2009-12-14 22:09:17 ville Exp $
+# $Id: check,v 1.756 2009-12-14 22:19:09 ville Exp $
#
# We need Perl 5.8.0+.
@@ -197,7 +197,7 @@ EOF
#
# Strings
- $VERSION = q$Revision: 1.755 $;
+ $VERSION = q$Revision: 1.756 $;
$VERSION =~ s/Revision: ([\d\.]+) /$1/;
# Read friendly error message file
@@ -641,20 +641,15 @@ if (&is_xml($File)) {
$xml_string = undef;
my $xml_parse_errors_line = undef;
my @xmlwf_error_list;
- my @xmlwf_obj_error_list;
if (ref($@)) {
# handle a structured error (XML::LibXML::Error object)
# (lib XML::LibXML > 0.66, but will work MUCH better > 0.69 )
- push(@xmlwf_obj_error_list, $@);
+
my $err_obj = $@;
- while ($err_obj->_prev()) {
- $err_obj = $err_obj->_prev();
- unshift(@xmlwf_obj_error_list, $err_obj);
- }
my $num_xmlwf_error = 0;
- foreach my $err_obj (@xmlwf_obj_error_list) {
+ while ($err_obj) {
my $err;
$err->{src} = '...'; # do this with show_open_entities()?
$err->{line} = $err_obj->line();
@@ -674,8 +669,10 @@ if (&is_xml($File)) {
$err = undef;
next;
}
- push(@xmlwf_error_list, $err);
+
+ unshift(@xmlwf_error_list, $err);
$num_xmlwf_error++;
+ $err_obj = $err_obj->_prev();
}
}
elsif ($@) {