W3C home > Mailing lists > Public > www-validator-cvs@w3.org > August 2010

link-checker commit: Avoid division by zero in progress indicator for docs that contain no linefeeds.

From: Mercurial notifier <nobody@w3.org>
Date: Thu, 05 Aug 2010 14:47:12 +0000
To: link-checker updates <www-validator-cvs@w3.org>
Message-Id: <E1Oh1iy-0005ze-D7@blinky.w3.org>
changeset:   214:2e1268446f7f
user:        ville
date:        Sun Feb 10 12:06:32 2008 +0000
files:       bin/checklink
description:
Avoid division by zero in progress indicator for docs that contain no linefeeds.


diff -r b142e4174275 -r 2e1268446f7f bin/checklink
--- a/bin/checklink	Sun Feb 10 12:02:29 2008 +0000
+++ b/bin/checklink	Sun Feb 10 12:06:32 2008 +0000
@@ -5,7 +5,7 @@
 # (c) 1999-2008 World Wide Web Consortium
 # based on Renaud Bruyeron's checklink.pl
 #
-# $Id: checklink,v 4.84 2008-02-10 12:02:29 ville Exp $
+# $Id: checklink,v 4.85 2008-02-10 12:06:32 ville Exp $
 #
 # This program is licensed under the W3C(r) Software License:
 #       http://www.w3.org/Consortium/Legal/copyright-software
@@ -244,7 +244,7 @@
   $PROGRAM     = 'W3C-checklink';
   $VERSION     = '4.3';
   $REVISION    = sprintf('version %s (c) 1999-2008 W3C', $VERSION);
-  my ($cvsver) = q$Revision: 4.84 $ =~ /(\d+[\d\.]*\.\d+)/;
+  my ($cvsver) = q$Revision: 4.85 $ =~ /(\d+[\d\.]*\.\d+)/;
   $AGENT       = sprintf('%s/%s [%s] %s',
                          $PROGRAM, $VERSION, $cvsver, LWP::RobotUA->_agent());
 
@@ -1431,7 +1431,7 @@
 {
   my ($self, $line) = @_;
   printf("\r%4d%%", int($line/$self->{Total}*100))
-    if (defined($line) && $line >= 0);
+    if (defined($line) && $line >= 0 && $self->{Total} > 0);
   return;
 }
 
Received on Thursday, 5 August 2010 14:47:32 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 15:17:44 UTC