1 7383736c 2005-02-15 devnull #!/usr/bin/perl
4 7383736c 2005-02-15 devnull my $root = $ENV{'PLAN9'};
5 7383736c 2005-02-15 devnull my $html = join("", @_);
6 7383736c 2005-02-15 devnull $html =~ s;$root;XXX$root;g;
7 7383736c 2005-02-15 devnull while($html =~ /((.|\n)*)XXX($root\/([a-zA-Z0-9_.\/]|−)*[a-zA-Z0-9_\/])((.|\n)*)/){
8 7383736c 2005-02-15 devnull ($a, $b, $c) = ($1, $3, $5);
9 7383736c 2005-02-15 devnull $b =~ s/−/-/g;
11 7383736c 2005-02-15 devnull while(! -e $l){
12 7383736c 2005-02-15 devnull if($l =~ /(.*\/)(.+)/){
18 7383736c 2005-02-15 devnull $bb = substr($b, length($l));
20 7383736c 2005-02-15 devnull $b =~ s/-/\−/g;
21 7383736c 2005-02-15 devnull $bb =~ s/-/\−/g;
22 7383736c 2005-02-15 devnull $html = "$a<a href=\"$l\">$b</a>$bb$c";
24 7383736c 2005-02-15 devnull print $html;