=================================================================== RCS file: /cvs/cvsweb/cvsweb.cgi,v retrieving revision 1.1.1.4 retrieving revision 3.20 diff -u -p -r1.1.1.4 -r3.20 --- cvsweb/cvsweb.cgi 2000/09/03 18:41:30 1.1.1.4 +++ cvsweb/cvsweb.cgi 2000/09/10 11:54:21 3.20 @@ -42,7 +42,7 @@ # SUCH DAMAGE. # # $zId: cvsweb.cgi,v 1.94 2000/08/24 06:41:22 hnordstrom Exp $ -# $kId: cvsweb.cgi,v 1.17 2000/09/03 18:25:47 knu Exp $ +# $Id: cvsweb.cgi,v 3.20 2000/09/10 11:54:21 knu Exp $ # ### @@ -82,7 +82,7 @@ use vars qw ( sub printDiffSelect($); sub findLastModifiedSubdirs(@); sub htmlify($;$); -sub spacedHtmlText($); +sub spacedHtmlText($;$); sub link($$); sub revcmp($$); sub fatal($$); @@ -896,55 +896,52 @@ sub htmlify($;$) { $string =~ s/>/>/g; # get URL's as link .. - $string =~ s`(http|ftp|https)(://[-a-zA-Z0-9%.~:_/]+)([?&]([-a-zA-Z0-9%.~:_]+)=([-a-zA-Z0-9%.~:_])+)*`$1$2$3`g; + $string =~ s`(http|ftp|https)(://[-a-zA-Z0-9%.~:_/]+)([?&]([-a-zA-Z0-9%.~:_]+)=([-a-zA-Z0-9%.~:_])+)*`$1$2$3`g; # ` # get e-mails as link - $string =~ s`([-a-zA-Z0-9_.]+@([-a-zA-Z0-9]+\.)+[A-Za-z]{2,4})`$1`g; + $string =~ s`([-a-zA-Z0-9_.]+@([-a-zA-Z0-9]+\.)+[A-Za-z]{2,4})`$1`g; # ` if ($extra) { # get PR #'s as link .. if (defined($prcgi)) { - 1 while $string =~ s`\b(pr[:#]?\s*(?:#?\d+[,\s]\s*)*#?)(\d+)\b`sprintf('%s%s', $1, sprintf($prcgi, $2), $2)`ie; - $string =~ s`\b${prcategories}/(\d+)\b`sprintf('%s', sprintf($prcgi, $1), $&)`igeo; + 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`&link($&, sprintf($prcgi, $1))`igeo; # ` } # get manpage specs as link .. if (defined($mancgi)) { - $string =~ s`\b([a-zA-Z]\w+)\(([0-9n])\)\B`sprintf('%s', sprintf($mancgi, $2, $1), $&)`ge; + $string =~ s`\b([a-zA-Z]\w+)\(([0-9n])\)\B`&link($&, sprintf($mancgi, $2, $1))`ge; # ` } } return $string; } -sub spacedHtmlText($) { +sub spacedHtmlText($;$) { local $_ = $_[0]; + my $ts = $_[1] || $tabstop; - # Cut trailing spaces - s/\s+\n$//; + # Cut trailing spaces and tabs + s/[ \t]+$//; - # Expand tabs - s/\t+/' ' x (length($&) * $tabstop - length($`) % $tabstop)/e - if (defined($tabstop)); + if (defined($tabstop)) { + # Expand tabs + 1 while s/\t+/' ' x (length($&) * $ts - length($`) % $ts)/e + } # replace and (\001 is to protect us from htmlify) # gzip can make excellent use of this repeating pattern :-) - s/\001/\001%/g; #protect our & substitute if ($hr_breakable) { # make every other space 'breakable' - s/ / \001nbsp; \001nbsp; \001nbsp; \001nbsp;/g; # s/ / \001nbsp;/g; # 2 * # leave single space as it is - } - else { - s/ /\001nbsp;\001nbsp;\001nbsp;\001nbsp;\001nbsp;\001nbsp;\001nbsp;\001nbsp;/g; + } else { s/ /\001nbsp;/g; } $_ = htmlify($_); # unescape - s/\001([^%])/&$1/g; - s/\001%/\001/g; + y/\001/&/; return $_; } @@ -1182,6 +1179,7 @@ sub doAnnotate($$) { } else { $revprint = $lrev; $oldLusr = ""; + $revprint =~ s`^(\S+)`$1`; # ` } if ($lusr eq $oldLusr) { $usrprint = " "; @@ -2390,7 +2388,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 ""; @@ -2742,7 +2740,7 @@ sub http_header(;$) { sub html_header($) { my ($title) = @_; - my $version = '$zRevision: 1.94 $ $kRevision: 1.17 $'; #' + my $version = '$zRevision: 1.94 $ $Revision: 3.20 $'; #' http_header(); print <