version 3.17, 2000/09/03 18:25:47 |
version 3.20, 2000/09/10 11:54:21 |
|
|
sub printDiffSelect($); |
sub printDiffSelect($); |
sub findLastModifiedSubdirs(@); |
sub findLastModifiedSubdirs(@); |
sub htmlify($;$); |
sub htmlify($;$); |
sub spacedHtmlText($); |
sub spacedHtmlText($;$); |
sub link($$); |
sub link($$); |
sub revcmp($$); |
sub revcmp($$); |
sub fatal($$); |
sub fatal($$); |
Line 896 sub htmlify($;$) { |
|
Line 896 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>`g; # ` |
# 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>`g; # ` |
|
|
if ($extra) { |
if ($extra) { |
# get PR #'s as link .. |
# get PR #'s as link .. |
if (defined($prcgi)) { |
if (defined($prcgi)) { |
1 while $string =~ s`\b(pr[:#]?\s*(?:#?\d+[,\s]\s*)*#?)(\d+)\b`sprintf('%s<A HREF="%s">%s</A>', $1, sprintf($prcgi, $2), $2)`ie; |
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`sprintf('<A HREF="%s">%s</A>', sprintf($prcgi, $1), $&)`igeo; |
$string =~ s`\b${prcategories}/(\d+)\b`&link($&, sprintf($prcgi, $1))`igeo; # ` |
} |
} |
|
|
# get manpage specs as link .. |
# get manpage specs as link .. |
if (defined($mancgi)) { |
if (defined($mancgi)) { |
$string =~ s`\b([a-zA-Z]\w+)\(([0-9n])\)\B`sprintf('<A HREF="%s">%s</A>', sprintf($mancgi, $2, $1), $&)`ge; |
$string =~ s`\b([a-zA-Z]\w+)\(([0-9n])\)\B`&link($&, sprintf($mancgi, $2, $1))`ge; # ` |
} |
} |
} |
} |
|
|
return $string; |
return $string; |
} |
} |
|
|
sub spacedHtmlText($) { |
sub spacedHtmlText($;$) { |
local $_ = $_[0]; |
local $_ = $_[0]; |
|
my $ts = $_[1] || $tabstop; |
|
|
# Cut trailing spaces |
# Cut trailing spaces and tabs |
s/\s+\n$//; |
s/[ \t]+$//; |
|
|
# Expand tabs |
if (defined($tabstop)) { |
s/\t+/' ' x (length($&) * $tabstop - length($`) % $tabstop)/e |
# Expand tabs |
if (defined($tabstop)); |
1 while s/\t+/' ' x (length($&) * $ts - length($`) % $ts)/e |
|
} |
|
|
# replace <tab> and <space> (\001 is to protect us from htmlify) |
# replace <tab> and <space> (\001 is to protect us from htmlify) |
# gzip can make excellent use of this repeating pattern :-) |
# gzip can make excellent use of this repeating pattern :-) |
s/\001/\001%/g; #protect our & substitute |
|
if ($hr_breakable) { |
if ($hr_breakable) { |
# make every other space 'breakable' |
# make every other space 'breakable' |
s/ / \001nbsp; \001nbsp; \001nbsp; \001nbsp;/g; # <tab> |
|
s/ / \001nbsp;/g; # 2 * <space> |
s/ / \001nbsp;/g; # 2 * <space> |
# leave single space as it is |
# leave single space as it is |
} |
} else { |
else { |
|
s/ /\001nbsp;\001nbsp;\001nbsp;\001nbsp;\001nbsp;\001nbsp;\001nbsp;\001nbsp;/g; |
|
s/ /\001nbsp;/g; |
s/ /\001nbsp;/g; |
} |
} |
|
|
$_ = htmlify($_); |
$_ = htmlify($_); |
|
|
# unescape |
# unescape |
s/\001([^%])/&$1/g; |
y/\001/&/; |
s/\001%/\001/g; |
|
|
|
return $_; |
return $_; |
} |
} |
Line 1182 sub doAnnotate($$) { |
|
Line 1179 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 = " "; |