=================================================================== RCS file: /cvs/cvsweb/cvsweb.cgi,v retrieving revision 3.19 retrieving revision 3.20 diff -u -p -r3.19 -r3.20 --- cvsweb/cvsweb.cgi 2000/09/04 15:53:41 3.19 +++ 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 $ -# $Id: cvsweb.cgi,v 3.19 2000/09/04 15:53:41 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($$); @@ -916,35 +916,32 @@ sub htmlify($;$) { 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 $_; } @@ -2391,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 ""; @@ -2743,7 +2740,7 @@ sub http_header(;$) { sub html_header($) { my ($title) = @_; - my $version = '$zRevision: 1.94 $ $Revision: 3.19 $'; #' + my $version = '$zRevision: 1.94 $ $Revision: 3.20 $'; #' http_header(); print <