link-checker commit: Avoid warning when no realm is given in WWW-Authenticate.

changeset:   86:312c7f6c1bcf
user:        ville
date:        Tue Jun 08 19:23:10 2004 +0000
files:       bin/checklink
description:
Avoid warning when no realm is given in WWW-Authenticate.


diff -r 701d5c027cac -r 312c7f6c1bcf bin/checklink
--- a/bin/checklink	Tue Jun 08 17:37:37 2004 +0000
+++ b/bin/checklink	Tue Jun 08 19:23:10 2004 +0000
@@ -5,7 +5,7 @@
 # (c) 1999-2004 World Wide Web Consortium
 # based on Renaud Bruyeron's checklink.pl
 #
-# $Id: checklink,v 3.55 2004-06-08 17:15:02 ville Exp $
+# $Id: checklink,v 3.56 2004-06-08 19:23:10 ville Exp $
 #
 # This program is licensed under the W3C(r) Software License:
 #       http://www.w3.org/Consortium/Legal/copyright-software
@@ -112,7 +112,7 @@
   $PACKAGE       = 'W3C Link Checker';
   $PROGRAM       = 'W3C-checklink';
   $VERSION       = '3.9.3-dev';
-  my ($cvsver)   = q$Revision: 3.55 $ =~ /(\d+[\d\.]*\.\d+)/;
+  my ($cvsver)   = q$Revision: 3.56 $ =~ /(\d+[\d\.]*\.\d+)/;
   $REVISION      = sprintf('version %s [%s] (c) 1999-2004 W3C',
                            $VERSION, $cvsver);
   $AGENT         = sprintf('%s/%s [%s] %s',
@@ -1391,12 +1391,13 @@
   my $r = $_[0];
   $r->headers->www_authenticate =~ /Basic realm=\"([^\"]+)\"/;
   my $realm = $1;
+  $realm = '' unless defined($realm);
 
   if ($Opts{Command_Line}) {
     printf STDERR <<EOF, $r->request()->url(), $realm;
 
 Authentication is required for %s.
-The realm is %s.
+The realm is "%s".
 Use the -u and -p options to specify a username and password and the -d option
 to specify trusted domains.
 EOF
@@ -1412,7 +1413,7 @@
 <body>", $DocType, $Head);
     &banner(': 401 Authorization Required');
     printf("<p>
-  You need %s access to <a href=\"%s\">%s</a> to perform link checking.<br>
+  You need \"%s\" access to <a href=\"%s\">%s</a> to perform link checking.<br>
 ", &encode($realm), (&encode($r->request()->url())) x 2);
 
     if ($Opts{Trusted}) {

Received on Thursday, 5 August 2010 14:47:02 UTC