- From: Ville Skytta via cvs-syncmail <cvsmail@w3.org>
- Date: Thu, 25 May 2006 08:00:00 +0000
- To: www-validator-cvs@w3.org
Update of /sources/public/perl/modules/W3C/LinkChecker/bin
In directory hutz:/tmp/cvs-serv3943
Modified Files:
checklink
Log Message:
Improve unknown line number handling.
Index: checklink
===================================================================
RCS file: /sources/public/perl/modules/W3C/LinkChecker/bin/checklink,v
retrieving revision 4.29
retrieving revision 4.30
diff -u -d -r4.29 -r4.30
--- checklink 6 May 2006 18:24:10 -0000 4.29
+++ checklink 25 May 2006 07:59:58 -0000 4.30
@@ -1247,7 +1247,8 @@
sub parse_progress
{
my ($self, $line) = @_;
- printf("\r%4d%%", int($line/$self->{Total}*100));
+ printf("\r%4d%%", int($line/$self->{Total}*100))
+ if (defined($line) && $line >= 0);
}
#############################
@@ -1283,6 +1284,7 @@
sub start
{
my ($self, $tag, $attr, $text, $line) = @_;
+ $line = -1 unless defined($line);
# Anchors
my $anchor = $self->get_anchor($tag, $attr);
@@ -1311,6 +1313,8 @@
sub declaration
{
my ($self, $text, $line) = @_;
+ $line = -1 unless defined($line);
+
# Extract the doctype
my @declaration = split(/\s+/, $text, 4);
if (($#declaration >= 3) &&
@@ -1573,7 +1577,8 @@
foreach my $anchor (@errors) {
my $format;
- my @unique = &sort_unique(keys %{$anchors->{$anchor}});
+ my @unique = &sort_unique(map { $_ < 0 ? "(N/A)" : $_ }
+ keys %{$anchors->{$anchor}});
if ($Opts{HTML}) {
$format = "<tr class=\"broken\"><td>%s</td><td>%s</td></tr>\n";
} else {
@@ -1657,7 +1662,7 @@
$whattodo = 'Add a trailing slash to the URL.';
}
- my @unique = &sort_unique(@total_lines);
+ my @unique = &sort_unique(map { $_ < 0 ? "(N/A)" : $_ } @total_lines);
my $lines_list = join(', ', @unique);
my $s = (scalar(@unique) > 1) ? 's' : '';
undef @unique;
Received on Thursday, 25 May 2006 08:00:06 UTC