aboutsummaryrefslogtreecommitdiff
path: root/dist/addsrclinks
diff options
context:
space:
mode:
authorRuss Cox <rsc@swtch.com>2008-07-03 18:50:23 -0400
committerRuss Cox <rsc@swtch.com>2008-07-03 18:50:23 -0400
commit020c5cbb6745ff203327b198e17b45b62e20a883 (patch)
treeace25cbd6ce9339e7617be656d8c8cbe15d299a9 /dist/addsrclinks
parent806c4c953cd9eeb4358202bd0daa273342d5bdc9 (diff)
downloadplan9port-020c5cbb6745ff203327b198e17b45b62e20a883.tar.gz
plan9port-020c5cbb6745ff203327b198e17b45b62e20a883.tar.bz2
plan9port-020c5cbb6745ff203327b198e17b45b62e20a883.zip
dist: new, linear addsrclinks
Diffstat (limited to 'dist/addsrclinks')
-rwxr-xr-xdist/addsrclinks11
1 files changed, 7 insertions, 4 deletions
diff --git a/dist/addsrclinks b/dist/addsrclinks
index edaa3d42..ef73be70 100755
--- a/dist/addsrclinks
+++ b/dist/addsrclinks
@@ -4,8 +4,9 @@
my $root = $ENV{'PLAN9'};
my $html = join("", @_);
$html =~ s;$root/;XXX$root/;g;
-while($html =~ /((.|\n)*)XXX($root\/([a-zA-Z0-9_.\/]|&#8722;)*[a-zA-Z0-9_\/])((.|\n)*)/){
- ($a, $b, $c) = ($1, $3, $5);
+$newhtml = "";
+while($html =~ /XXX($root\/([a-zA-Z0-9_.\/]|&#8722;)*[a-zA-Z0-9_\/])/){
+ ($a, $b, $c) = ($`, $1, $');
$b =~ s/&#8722;/-/g;
$l = $b;
while(! -e $l){
@@ -19,6 +20,8 @@ while($html =~ /((.|\n)*)XXX($root\/([a-zA-Z0-9_.\/]|&#8722;)*[a-zA-Z0-9_\/])((.
$b = $l;
$b =~ s/-/\&#8722;/g;
$bb =~ s/-/\&#8722;/g;
- $html = "$a<a href=\"$l\">$b</a>$bb$c";
+ $newhtml .= "$a<a href=\"$l\">$b</a>$bb";
+ $html = $c;
}
-print $html;
+$newhtml .= $html;
+print $newhtml;