W3C home > Mailing lists > Public > www-validator-cvs@w3.org > February 2008

perl/modules/W3C/LinkChecker/bin checklink,4.88,4.89

From: Ville Skytta via cvs-syncmail <cvsmail@w3.org>
Date: Sun, 10 Feb 2008 13:25:23 +0000
To: www-validator-cvs@w3.org
Message-Id: <E1JOCBP-0001Na-PF@lionel-hutz.w3.org>

Update of /sources/public/perl/modules/W3C/LinkChecker/bin
In directory hutz:/tmp/cvs-serv4922

Modified Files:
	checklink 
Log Message:
Output number of lines processed instead of total number of lines in docs.


Index: checklink
===================================================================
RCS file: /sources/public/perl/modules/W3C/LinkChecker/bin/checklink,v
retrieving revision 4.88
retrieving revision 4.89
diff -u -d -r4.88 -r4.89
--- checklink	10 Feb 2008 13:20:11 -0000	4.88
+++ checklink	10 Feb 2008 13:25:21 -0000	4.89
@@ -1335,9 +1335,12 @@
     $start = &get_timestamp();
     print("Parsing...\n");
   }
-  if (!$Opts{Summary_Only} || $Opts{Progress}) {
-    $p->{Total} = ($$docref =~ tr/\n//);
-  }
+
+  # Count lines beforehand if needed for progress indicator.  In all cases,
+  # the actual final number of lines processed shown is populated by our
+  # end_document handler.
+  $p->{Total} = ($$docref =~ tr/\n//) if $Opts{Progress};
+
   # We only look for anchors if we are not interested in the links
   # obviously, or if we are running a recursive checking because we
   # might need this information later
@@ -1386,6 +1389,7 @@
               }, 'self, text, line');
   # Other stuff
   $p->handler(default => 'parse_progress', 'self, line') if $Opts{Progress};
+  $p->handler(end_document => 'end_document', 'self, line');
   # Check <a [..] name="...">?
   $p->{check_name} = 1;
   # Check <[..] id="..">?
@@ -1536,6 +1540,13 @@
   return;
 }
 
+sub end_document
+{
+  my ($self, $line) = @_;
+  $self->{Total} = $line;
+  return;
+}
+
 ################################
 # Check the validity of a link #
 ################################
Received on Sunday, 10 February 2008 13:26:04 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Thursday, 26 April 2012 12:55:00 GMT