version 1.1.1.5, 2000/09/04 16:00:28 |
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.19 2000/09/04 15:53:41 knu Exp $ |
# $Id$ |
# |
# |
### |
### |
|
|
|
|
%CVSROOT %CVSROOTdescr %MIRRORS %DEFAULTVALUE %ICONS %MTYPES |
%CVSROOT %CVSROOTdescr %MIRRORS %DEFAULTVALUE %ICONS %MTYPES |
%alltags @tabcolors %fileinfo %tags @branchnames %nameprinted |
%alltags @tabcolors %fileinfo %tags @branchnames %nameprinted |
%symrev %revsym @allrevisions %date %author @revdisplayorder |
%symrev %revsym @allrevisions %date %author @revdisplayorder |
@revisions %state %difflines %log %branchpoint @revorder |
@revisions %state %difflines %log %branchpoint @revorder $prcgi |
$prcgi @prcategories $prcategories $mancgi |
@prcategories $prcategories |
$checkoutMagic $doCheckout $scriptname $scriptwhere |
$checkoutMagic $doCheckout $scriptname $scriptwhere |
$where $pathinfo $Browser $nofilelinks $maycompress @stickyvars |
$where $pathinfo $Browser $nofilelinks $maycompress @stickyvars |
%funcline_regexp $is_mod_perl |
%funcline_regexp $is_mod_perl |
Line 347 foreach my $k (keys %ICONS) { |
|
Line 347 foreach my $k (keys %ICONS) { |
|
do "$config-$cvstree" if (-f "$config-$cvstree"); |
do "$config-$cvstree" if (-f "$config-$cvstree"); |
|
|
$prcategories = '(?:' . join('|', @prcategories) . ')'; |
$prcategories = '(?:' . join('|', @prcategories) . ')'; |
$prcgi .= '%s' if defined($prcgi) && $prcgi !~ /%s/; |
|
|
|
$fullname = $cvsroot . '/' . $where; |
$fullname = $cvsroot . '/' . $where; |
$mimetype = &getMimeTypeFromSuffix ($fullname); |
$mimetype = &getMimeTypeFromSuffix ($fullname); |
Line 887 sub findLastModifiedSubdirs(@) { |
|
Line 886 sub findLastModifiedSubdirs(@) { |
|
} |
} |
|
|
sub htmlify($;$) { |
sub htmlify($;$) { |
my($string, $extra) = @_; |
my($string, $pr) = @_; |
|
|
# Special Characters; RFC 1866 |
# Special Characters; RFC 1866 |
$string =~ s/&/&/g; |
$string =~ s/&/&/g; |
Line 896 sub htmlify($;$) { |
|
Line 895 sub htmlify($;$) { |
|
$string =~ s/>/>/g; |
$string =~ s/>/>/g; |
|
|
# get URL's as link .. |
# get URL's as link .. |
$string =~ s`(http|ftp|https)(://[-a-zA-Z0-9%.~:_/]+)([?&]([-a-zA-Z0-9%.~:_]+)=([-a-zA-Z0-9%.~:_])+)*`<A HREF="$1$2$3">$1$2$3</A>`g; # ` |
$string =~ s`(http|ftp|https)(://[-a-zA-Z0-9%.~:_/]+)([?&]([-a-zA-Z0-9%.~:_]+)=([-a-zA-Z0-9%.~:_])+)*`<A HREF="$1$2$3">$1$2$3</A>`; |
# get e-mails as link |
# get e-mails as link |
$string =~ s`([-a-zA-Z0-9_.]+@([-a-zA-Z0-9]+\.)+[A-Za-z]{2,4})`<A HREF="mailto:$1">$1</A>`g; # ` |
$string =~ s`([-a-zA-Z0-9_.]+@([-a-zA-Z0-9]+\.)+[A-Za-z]{2,4})`<A HREF="mailto:$1">$1</A>`; |
|
|
if ($extra) { |
# get #PR as link .. |
# get PR #'s as link .. |
if ($pr && defined($prcgi)) { |
if (defined($prcgi)) { |
1 while $string =~ s`\b(pr[:#]?\s*(?:#?\d+[,\s]\s*)*#?)(\d+)\b`$1<A HREF="$prcgi$2">$2</A>`i; |
1 while $string =~ s`\b(pr[:#]?\s*(?:#?\d+[,\s]\s*)*#?)(\d+)\b`$1 . &link($2, sprintf($prcgi, $2))`ie; # ` |
$string =~ s`\b${prcategories}/(\d+)\b`<A HREF="$prcgi$1">$&</A>`igo; |
$string =~ s`\b${prcategories}/(\d+)\b`&link($&, sprintf($prcgi, $1))`igeo; # ` |
|
} |
|
|
|
# get manpage specs as link .. |
|
if (defined($mancgi)) { |
|
$string =~ s`\b([a-zA-Z]\w+)\(([0-9n])\)\B`&link($&, sprintf($mancgi, $2, $1))`ge; # ` |
|
} |
|
} |
} |
|
|
return $string; |
return $string; |
Line 920 sub spacedHtmlText($) { |
|
Line 912 sub spacedHtmlText($) { |
|
local $_ = $_[0]; |
local $_ = $_[0]; |
|
|
# Cut trailing spaces |
# Cut trailing spaces |
s/\s+$/\n/; |
s/\s+\n$//; |
|
|
# Expand tabs |
# Expand tabs |
s/\t+/' ' x (length($&) * $tabstop - length($`) % $tabstop)/e |
s/\t+/' ' x (length($&) * $tabstop - length($`) % $tabstop)/e |
|
|
|
|
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 1075 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 1182 sub doAnnotate($$) { |
|
Line 1170 sub doAnnotate($$) { |
|
} |
} |
else { |
else { |
$revprint = $lrev; $oldLusr = ""; |
$revprint = $lrev; $oldLusr = ""; |
$revprint =~ s`^(\S+)`<a href="${scriptwhere}${barequery}#rev$1">$1</A>`; # ` |
|
} |
} |
if ($lusr eq $oldLusr) { |
if ($lusr eq $oldLusr) { |
$usrprint = " "; |
$usrprint = " "; |
Line 1227 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 1269 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 1386 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 1431 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 2391 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.19 $ -->'; |
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 2743 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.19 $'; #' |
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" |