From 020c5cbb6745ff203327b198e17b45b62e20a883 Mon Sep 17 00:00:00 2001 From: Russ Cox Date: Thu, 3 Jul 2008 18:50:23 -0400 Subject: dist: new, linear addsrclinks --- dist/addsrclinks | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'dist/addsrclinks') 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_.\/]|−)*[a-zA-Z0-9_\/])((.|\n)*)/){ - ($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){ @@ -19,6 +20,8 @@ while($html =~ /((.|\n)*)XXX($root\/([a-zA-Z0-9_.\/]|−)*[a-zA-Z0-9_\/])((. $b = $l; $b =~ s/-/\−/g; $bb =~ s/-/\−/g; - $html = "$a$b$bb$c"; + $newhtml .= "$a$b$bb"; + $html = $c; } -print $html; +$newhtml .= $html; +print $newhtml; -- cgit v1.2.3