version 1.1.1.3, 2000/08/25 09:13:40 |
version 3.14, 2000/08/24 15:53:11 |
|
|
# SUCH DAMAGE. |
# SUCH DAMAGE. |
# |
# |
# $zId: cvsweb.cgi,v 1.94 2000/08/24 06:41:22 hnordstrom Exp $ |
# $zId: cvsweb.cgi,v 1.94 2000/08/24 06:41:22 hnordstrom Exp $ |
# $kId: cvsweb.cgi,v 1.15 2000/08/25 09:01:58 knu Exp $ |
# $Id$ |
# |
# |
### |
### |
|
|
|
|
|
|
sub revcmp($$) { |
sub revcmp($$) { |
my($rev1, $rev2) = @_; |
my($rev1, $rev2) = @_; |
|
|
# make no comparison for a tag or a branch |
|
return 0 if $rev1 =~ /[^\d.]/ || $rev2 =~ /[^\d.]/; |
|
|
|
my(@r1) = split(/\./, $rev1); |
my(@r1) = split(/\./, $rev1); |
my(@r2) = split(/\./, $rev2); |
my(@r2) = split(/\./, $rev2); |
my($a,$b); |
my($a,$b); |
Line 1067 sub doAnnotate($$) { |
|
Line 1063 sub doAnnotate($$) { |
|
|
|
# make sure the revisions a wellformed, for security |
# make sure the revisions a wellformed, for security |
# reasons .. |
# reasons .. |
if ($rev =~ /[^\w.]/) { |
if (!($rev =~ /^[\d\.]+$/)) { |
&fatal("404 Not Found", |
&fatal("404 Not Found", |
"Malformed query \"$ENV{QUERY_STRING}\""); |
"Malformed query \"$ENV{QUERY_STRING}\""); |
} |
} |
Line 1218 sub doCheckout($$) { |
|
Line 1214 sub doCheckout($$) { |
|
my ($mimetype,$revopt); |
my ($mimetype,$revopt); |
my $fh = do {local(*FH);}; |
my $fh = do {local(*FH);}; |
|
|
if ($rev eq 'HEAD' || $rev eq '.') { |
|
$rev = undef; |
|
} |
|
|
|
# make sure the revisions a wellformed, for security |
# make sure the revisions a wellformed, for security |
# reasons .. |
# reasons .. |
if (defined($rev) && $rev =~ /[^\w.]/) { |
if (defined($rev) && !($rev =~ /^[\d\.]+$/)) { |
&fatal("404 Not Found", |
&fatal("404 Not Found", |
"Malformed query \"$ENV{QUERY_STRING}\""); |
"Malformed query \"$ENV{QUERY_STRING}\""); |
} |
} |
Line 1260 sub doCheckout($$) { |
|
Line 1252 sub doCheckout($$) { |
|
# Safely for a child process to read from. |
# Safely for a child process to read from. |
if (! open($fh, "-|")) { # child |
if (! open($fh, "-|")) { # child |
open(STDERR, ">&STDOUT"); # Redirect stderr to stdout |
open(STDERR, ">&STDOUT"); # Redirect stderr to stdout |
exec("cvs", "-Rld", $cvsroot, "co", "-p", $revopt, $where); |
exec("cvs", "-d", $cvsroot, "co", "-p", $revopt, $where); |
} |
} |
#=================================================================== |
#=================================================================== |
#Checking out squid/src/ftp.c |
#Checking out squid/src/ftp.c |
Line 1377 sub doDiff($$$$$$) { |
|
Line 1369 sub doDiff($$$$$$) { |
|
$rev2 = $tr2; |
$rev2 = $tr2; |
$sym2 = ""; |
$sym2 = ""; |
} |
} |
|
|
# make sure the revisions a wellformed, for security |
# make sure the revisions a wellformed, for security |
# reasons .. |
# reasons .. |
if ($rev1 =~ /[^\w.]/ || $rev2 =~ /[^\w.]/) { |
if (!($rev1 =~ /^[\d\.]+$/) || !($rev2 =~ /^[\d\.]+$/)) { |
&fatal("404 Not Found", |
&fatal("404 Not Found", |
"Malformed query \"$ENV{QUERY_STRING}\""); |
"Malformed query \"$ENV{QUERY_STRING}\""); |
} |
} |
Line 1422 sub doDiff($$$$$$) { |
|
Line 1413 sub doDiff($$$$$$) { |
|
|
|
# apply special options |
# apply special options |
if ($showfunc) { |
if ($showfunc) { |
push @difftype, '-p' if $f =~ /^[cHhu]$/; |
push @difftype, '-p'; |
|
|
my($re1, $re2); |
my($re1, $re2); |
|
|
Line 2382 sub navigateHeader($$$$$) { |
|
Line 2373 sub navigateHeader($$$$$) { |
|
$swhere = urlencode($filename) if ($swhere eq ""); |
$swhere = urlencode($filename) if ($swhere eq ""); |
print "<\!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\">"; |
print "<\!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\">"; |
print "<HTML>\n<HEAD>\n"; |
print "<HTML>\n<HEAD>\n"; |
print '<!-- CVSweb $zRevision: 1.94 $ $kRevision: 1.15 $ -->'; |
print '<!-- CVSweb $zRevision: 1.94 $ $Revision$ -->'; |
print "\n<TITLE>$path$filename - $title - $rev</TITLE></HEAD>\n"; |
print "\n<TITLE>$path$filename - $title - $rev</TITLE></HEAD>\n"; |
print "<BODY BGCOLOR=\"$backcolor\">\n"; |
print "<BODY BGCOLOR=\"$backcolor\">\n"; |
print "<table width=\"100%\" border=0 cellspacing=0 cellpadding=1 bgcolor=\"$navigationHeaderColor\">"; |
print "<table width=\"100%\" border=0 cellspacing=0 cellpadding=1 bgcolor=\"$navigationHeaderColor\">"; |
Line 2734 sub http_header(;$) { |
|
Line 2725 sub http_header(;$) { |
|
|
|
sub html_header($) { |
sub html_header($) { |
my ($title) = @_; |
my ($title) = @_; |
my $version = '$zRevision: 1.94 $ $kRevision: 1.15 $'; #' |
my $version = '$zRevision: 1.94 $ $Revision$'; #' |
http_header(); |
http_header(); |
print <<EOH; |
print <<EOH; |
<!doctype html public "-//W3C//DTD HTML 4.0 Transitional//EN" |
<!doctype html public "-//W3C//DTD HTML 4.0 Transitional//EN" |