tdist: new, linear addsrclinks - plan9port - [fork] Plan 9 from user space | |
git clone git://src.adamsgaard.dk/plan9port | |
Log | |
Files | |
Refs | |
README | |
LICENSE | |
--- | |
commit 020c5cbb6745ff203327b198e17b45b62e20a883 | |
parent 806c4c953cd9eeb4358202bd0daa273342d5bdc9 | |
Author: Russ Cox <[email protected]> | |
Date: Thu, 3 Jul 2008 18:50:23 -0400 | |
dist: new, linear addsrclinks | |
Diffstat: | |
M dist/addsrclinks | 11 +++++++---- | |
1 file changed, 7 insertions(+), 4 deletions(-) | |
--- | |
diff --git a/dist/addsrclinks b/dist/addsrclinks | |
t@@ -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_.\/]|−)*[a-zA-Z0-9_\/])(… | |
- ($a, $b, $c) = ($1, $3, $5); | |
+$newhtml = ""; | |
+while($html =~ /XXX($root\/([a-zA-Z0-9_.\/]|−)*[a-zA-Z0-9_\/])/){ | |
+ ($a, $b, $c) = ($`, $1, $'); | |
$b =~ s/−/-/g; | |
$l = $b; | |
while(! -e $l){ | |
t@@ -19,6 +20,8 @@ while($html =~ /((.|\n)*)XXX($root\/([a-zA-Z0-9_.\/]|−… | |
$b = $l; | |
$b =~ s/-/\−/g; | |
$bb =~ s/-/\−/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; |