=================================================================== RCS file: /cvs/cvsweb/cvsweb.cgi,v retrieving revision 3.4 retrieving revision 3.10 diff -u -p -r3.4 -r3.10 --- cvsweb/cvsweb.cgi 2000/07/28 17:24:35 3.4 +++ cvsweb/cvsweb.cgi 2000/08/01 12:42:07 3.10 @@ -1,4 +1,4 @@ -#!/usr/bin/perl -ws +#!/usr/bin/perl5 -ws # # cvsweb - a CGI interface to CVS trees. # @@ -12,7 +12,7 @@ # # Based on: # * Bill Fenners cvsweb.cgi revision 1.28 available from: -# http://www.freebsd.org/cgi/cvsweb.cgi/www/en/cgi/cvsweb.cgi +# http://www.FreeBSD.org/cgi/cvsweb.cgi/www/en/cgi/cvsweb.cgi # # Copyright (c) 1996-1998 Bill Fenner # (c) 1998-1999 Henner Zeller @@ -41,7 +41,8 @@ # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF # SUCH DAMAGE. # -# $Id: cvsweb.cgi,v 3.4 2000/07/28 17:24:35 knu Exp $ +# $zId: cvsweb.cgi,v 1.93 2000/07/27 17:42:28 hzeller Exp $ +# $Id: cvsweb.cgi,v 3.10 2000/08/01 12:42:07 knu Exp $ # ### @@ -57,7 +58,7 @@ use vars qw ( $checkoutMagic $doCheckout $scriptname $scriptwhere $where $pathinfo $Browser $nofilelinks $maycompress @stickyvars %funcline_regexp $is_mod_perl - $is_lynx $is_msie $is_mozilla3 + $is_lynx $is_w3m $is_msie $is_mozilla3 $is_textbased %input $query $barequery $sortby $bydate $byrev $byauthor $bylog $byfile $hr_default $logsort $cvstree $cvsroot $mimetype $defaultTextPlain $defaultViewable $allow_compress @@ -133,12 +134,15 @@ $is_mod_perl = defined($ENV{MOD_PERL}); # per file, so disable the link at the icon # in this case: $Browser = $ENV{HTTP_USER_AGENT} || ''; -$is_lynx = ($Browser =~ m`^Lynx/`); +$is_lynx = ($Browser =~ m`^Lynx/`i); +$is_w3m = ($Browser =~ m`^w3m/`i); $is_msie = ($Browser =~ m`MSIE`); -$is_mozilla3 = ($Browser =~ m`^Mozilla/[3456789]`); +$is_mozilla3 = ($Browser =~ m`^Mozilla/[3-9]`); -$nofilelinks = $is_lynx; +$is_textbased = ($is_lynx || $is_w3m); +$nofilelinks = $is_textbased; + # newer browsers accept gzip content encoding # and state this in a header # (netscape did always but didn't state it) @@ -158,7 +162,7 @@ $maycompress =(($ENV{HTTP_ACCEPT_ENCODING} =~ m`gzip` # to hold our state - they will be added (with # their current value) to any link/query string # you construct -@stickyvars = qw(cvsroot hideattic sortby logsort fonly_with_tag); +@stickyvars = qw(cvsroot hideattic sortby logsort f only_with_tag); if (-f $config) { do $config; @@ -851,8 +855,8 @@ sub htmlify { # get #PR as link .. if ($pr && defined($prcgi)) { - 1 while $string =~ s`\b(pr[:#]?\s*(?:#?\d+[,\s]\s*)*#?)(\d+)\b`$1$2`i; - $string =~ s`\b${prcategories}/(\d+)\b`$&`igo; + 1 while $string =~ s`\b(pr[:#]?\s*(?:#?\d+[,\s]\s*)*#?)(\d+)\b`$1$2`i; + $string =~ s`\b${prcategories}/(\d+)\b`$&`igo; } return $string; @@ -1469,15 +1473,15 @@ sub getDirLogs { if ($tag) { #can't use -r as - is allowed in tagnames, but misinterpreated by rlog.. if (! open($fh, "-|")) { - close(STDERR); # rlog may complain; ignore. - exec("rlog",@files); + open(STDERR, '>/dev/null'); # rlog may complain; ignore. + exec('rlog', @files); } } else { my $kidpid = open($fh, "-|"); if (! $kidpid) { open(STDERR, '>/dev/null'); # rlog may complain; ignore. - exec("rlog","-r",@files); + exec('rlog', '-r', @files); } } $state = "start"; @@ -2326,7 +2330,7 @@ sub navigateHeader ($$$$$) { $swhere = urlencode($filename) if ($swhere eq ""); print "<\!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\">"; print "\n\n"; - print ''; + print ''; print "\n$path$filename - $title - $rev\n"; print "\n"; print ""; @@ -2680,7 +2684,7 @@ sub http_header { sub html_header($) { my ($title) = @_; - my $version = '$Revision: 3.4 $'; + my $version = '$zRevision: 1.93 $ $Revision: 3.10 $'; http_header(); print <