- From: Ville Skytta <ville@hutz.w3.org>
- Date: Sat, 10 Apr 2004 22:44:56 +0000
- To: www-validator-cvs@w3.org
Update of /sources/public/perl/modules/W3C/LinkChecker/bin In directory hutz:/tmp/cvs-serv24983 Modified Files: checklink Log Message: Code cleanups. Index: checklink =================================================================== RCS file: /sources/public/perl/modules/W3C/LinkChecker/bin/checklink,v retrieving revision 3.28 retrieving revision 3.29 diff -u -d -r3.28 -r3.29 --- checklink 10 Apr 2004 19:01:26 -0000 3.28 +++ checklink 10 Apr 2004 22:44:51 -0000 3.29 @@ -1540,6 +1540,7 @@ } my ($redirect_loop, @redirects_urls) = get_redirects($u, %$redirects); + my $currloc = $results->{$u}{location}; # Error type $c = &code_shown($u, $results); @@ -1547,7 +1548,7 @@ my $whattodo; my $redirect_too; if ($todo) { - my $currmsg = $results->{$u}{location}{message} || ''; + my $currmsg = $currloc->{message} || ''; if ($u =~ m/^javascript:/) { if ($Opts{HTML}) { $whattodo = @@ -1610,8 +1611,8 @@ } # HTTP message my $http_message; - if ($results->{$u}{location}{message}) { - $http_message = &encode($results->{$u}{location}{message}); + if ($currloc->{message}) { + $http_message = &encode($currloc->{message}); if ($c == 404 || $c == 500) { $http_message = '<span class="broken">'. $http_message.'</span>'; @@ -1639,20 +1640,18 @@ $redirect_too ? sprintf(' <span %s>%s</span>', &bgcolor(301), $redirect_too) : '', # Original HTTP reply - $results->{$u}{location}{orig}, + $currloc->{orig}, # Final HTTP reply - ($results->{$u}{location}{code} != - $results->{$u}{location}{orig}) + ($currloc->{code} != $currloc->{orig}) ? ' <span title="redirected to">-></span> '. - &encode($results->{$u}{location}{code}) + &encode($currloc->{code}) : '', # Realm - (defined($results->{$u}{location}{realm}) - ? 'Realm: '.&encode($results->{$u}{location}{realm}).'<br>' - : ''), + defined($currloc->{realm}) + ? sprintf('Realm: %s<br>', &encode($currloc->{realm})) : '', # HTTP original message - defined($results->{$u}{location}{orig_message}) - ? &encode($results->{$u}{location}{orig_message}). + defined($currloc->{orig_message}) + ? &encode($currloc->{orig_message}). ' <span title="redirected to">-></span> ' : '', # HTTP final message @@ -1662,7 +1661,7 @@ $lines_list); if ($#fragments >= 0) { my $fragment_direction = ''; - if ($results->{$u}{location}{code} == 200) { + if ($currloc->{code} == 200) { $fragment_direction = ' <strong class="broken">They need to be fixed!</strong>'; } @@ -1677,18 +1676,17 @@ # List of lines $lines_list ? "Line$s: $lines_list" : '', # Original HTTP reply - $results->{$u}{location}{orig}, + $currloc->{orig}, # Final HTTP reply - ($results->{$u}{location}{code} != $results->{$u}{location}{orig}) - ? ' -> '.$results->{$u}{location}{code} + ($currloc->{code} != $currloc->{orig}) + ? ' -> '.$currloc->{code} : '', # HTTP message - $results->{$u}{location}{message} ? - $results->{$u}{location}{message} : '', + $currloc->{message} || '', # What to do wrap(' To do: ', ' ', $whattodo)); if ($#fragments >= 0) { - if ($results->{$u}{location}{code} == 200) { + if ($currloc->{code} == 200) { print("The following fragments need to be fixed:\n"); } else { print("Fragments:\n");
Received on Saturday, 10 April 2004 18:45:05 UTC