W3C home > Mailing lists > Public > www-validator-cvs@w3.org > June 2004

perl/modules/W3C/LinkChecker/bin checklink,3.46,3.47

From: Ville Skytta <ville@dev.w3.org>
Date: Tue, 01 Jun 2004 19:18:35 +0000
To: www-validator-cvs@w3.org
Message-Id: <20040601191835.8EB044A850@hutz.w3.org>

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

Modified Files:
	checklink 
Log Message:
Avoid warning from invalid (non-numeric) recursion depth.

Index: checklink
===================================================================
RCS file: /sources/public/perl/modules/W3C/LinkChecker/bin/checklink,v
retrieving revision 3.46
retrieving revision 3.47
diff -u -d -r3.46 -r3.47
--- checklink	31 May 2004 21:40:47 -0000	3.46
+++ checklink	1 Jun 2004 19:18:33 -0000	3.47
@@ -198,7 +198,7 @@
     Accept_Language   => $cmdline ? undef : $ENV{HTTP_ACCEPT_LANGUAGE},
     HTTP_Proxy        => undef,
     Hide_Same_Realm   => 0,
-    Depth             => 0,    # -1 means unlimited recursion.
+    Depth             => 0,    # < 0 means unlimited recursion.
     Sleep_Time        => 1,
     Max_Documents     => 150,  # For the online version.
     User              => undef,
@@ -316,8 +316,9 @@
   $Opts{Accept_Language} = undef if $query->param('no_accept_language');
 
   $Opts{Depth} = -1 if ($query->param('recursive') && $Opts{Depth} == 0);
-  if ($query->param('depth') && ($query->param('depth') != 0)) {
-    $Opts{Depth} = $query->param('depth');
+  if (my $depth = $query->param('depth')) {
+    # Ignore invalid depth silently for now.
+    $Opts{Depth} = $1 if ($depth =~ /(-?\d+)/);
   }
 
   # Save, clear or leave cookie as is.
Received on Tuesday, 1 June 2004 15:18:35 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 23:02:06 UTC