From 46b112bcd439f4413925a7300d66a3e6f148765e Mon Sep 17 00:00:00 2001 From: Yang Tse Date: Tue, 16 Feb 2010 13:32:45 +0000 Subject: replaced tabs with spaces --- perl/contrib/checklinks.pl.in | 278 +++++++++++++++++++++--------------------- 1 file changed, 139 insertions(+), 139 deletions(-) (limited to 'perl/contrib/checklinks.pl.in') diff --git a/perl/contrib/checklinks.pl.in b/perl/contrib/checklinks.pl.in index 1b453742f..db70bb112 100644 --- a/perl/contrib/checklinks.pl.in +++ b/perl/contrib/checklinks.pl.in @@ -88,32 +88,32 @@ sub SplitURL { my $inurl = $_[0]; if($inurl=~ /^([^:]+):\/\/([^\/]*)\/(.*)\/(.*)/ ) { - $getprotocol = $1; - $getserver = $2; - $getpath = $3; - $getdocument = $4; + $getprotocol = $1; + $getserver = $2; + $getpath = $3; + $getdocument = $4; } elsif ($inurl=~ /^([^:]+):\/\/([^\/]*)\/(.*)/ ) { - $getprotocol = $1; - $getserver = $2; - $getpath = $3; - $getdocument = ""; - - if($getpath !~ /\//) { - $getpath =""; - $getdocument = $3; - } + $getprotocol = $1; + $getserver = $2; + $getpath = $3; + $getdocument = ""; + + if($getpath !~ /\//) { + $getpath =""; + $getdocument = $3; + } } elsif ($inurl=~ /^([^:]+):\/\/(.*)/ ) { - $getprotocol = $1; - $getserver = $2; - $getpath = ""; - $getdocument = ""; + $getprotocol = $1; + $getserver = $2; + $getpath = ""; + $getdocument = ""; } else { - print "Couldn't parse the specified URL, retry please!\n"; - exit; + print "Couldn't parse the specified URL, retry please!\n"; + exit; } } @@ -127,52 +127,52 @@ sub SplitURL { if(!$usestdin) { open(HEADGET, "$linkcheck $geturl|") || - die "Couldn't get web page for some reason"; + die "Couldn't get web page for some reason"; headget: while() { -# print $_; - if($_ =~ /HTTP\/.*3\d\d /) { - $pagemoved=1; - } - elsif($pagemoved && - ($_ =~ /^Location: (.*)/)) { - $geturl = $1; - - &SplitURL($geturl); - - $pagemoved++; - last headget; - } +# print $_; + if($_ =~ /HTTP\/.*3\d\d /) { + $pagemoved=1; + } + elsif($pagemoved && + ($_ =~ /^Location: (.*)/)) { + $geturl = $1; + + &SplitURL($geturl); + + $pagemoved++; + last headget; + } } close(HEADGET); if($pagemoved == 1) { - print "Page is moved but we don't know where. Did you forget the ", - "traling slash?\n"; - exit; + print "Page is moved but we don't know where. Did you forget the ", + "traling slash?\n"; + exit; } open(WEBGET, "$htmlget $geturl|") || - die "Couldn't get web page for some reason"; + die "Couldn't get web page for some reason"; while() { - $line = $_; - push @indoc, $line; - $line=~ s/\n//g; - $line=~ s/\r//g; -# print $line."\n"; - $in=$in.$line; + $line = $_; + push @indoc, $line; + $line=~ s/\n//g; + $line=~ s/\r//g; +# print $line."\n"; + $in=$in.$line; } close(WEBGET); } else { while() { - $line = $_; - push @indoc, $line; - $line=~ s/\n//g; - $line=~ s/\r//g; - $in=$in.$line; + $line = $_; + push @indoc, $line; + $line=~ s/\n//g; + $line=~ s/\r//g; + $in=$in.$line; } } @@ -193,21 +193,21 @@ sub LinkWorks { boo: if( $doc[0] =~ /^HTTP[^ ]+ (\d+)/ ) { - $error = $1; - - if($error < 400 ) { - return "GOOD"; - } - else { - - if($head && ($error >= 500)) { - # This server doesn't like HEAD! - @doc = `$linkcheckfull \"$check\"`; - $head = 0; - goto boo; - } - return "BAD"; - } + $error = $1; + + if($error < 400 ) { + return "GOOD"; + } + else { + + if($head && ($error >= 500)) { + # This server doesn't like HEAD! + @doc = `$linkcheckfull \"$check\"`; + $head = 0; + goto boo; + } + return "BAD"; + } } return "BAD"; } @@ -219,43 +219,43 @@ sub GetLinks { getlinkloop: while($in =~ /[^<]*(<[^>]+>)/g ) { - # we have a tag in $1 - $tag = $1; - - if($tag =~ /^