commit add3511e9bec8db231c645e6b44db8eb2b7ff315 from: rsc date: Fri Jan 14 21:01:19 2005 UTC fixurls commit - 0fdffa38a1a44f20dca78429ea96424d5eab07d2 commit + add3511e9bec8db231c645e6b44db8eb2b7ff315 blob - /dev/null blob + c9beba821b58e473021e652244013e33020b7705 (mode 755) --- /dev/null +++ dist/fixurls @@ -0,0 +1,34 @@ +#!/usr/bin/perl + +open(OMIT, "9 sed -n 's/.*Omitman\\[\"(.*)\\((.)\\)\".*/\\1 \\2/p' /usr/local/plan9/dist/checkman.awk |") || die "omit: $!"; +@omit = ; +close OMIT; +chomp @omit; +# push @omit, "grep 1", "lseek 2", "tcs 1", "sed 1", "rc 1", "strcat 3", "yacc 1"; + +sub noref { + my ($p, $s) = @_; + + $text =~ s!(([^<]|<[^/]|!\1!g; +} + +for($i=0; $i<@ARGV; $i++){ + open(IN, $ARGV[$i]) || die "open $ARGV[$i]: $!"; + @text = ; + close IN; + $text = join("", @text); + + foreach $o (@omit) { + $o =~ /(.*) (.*)/; + noref($1, $2); + } + + $text =~ s!../man(.)/([^.]*)\.html!$2$1.html!g; + $text =~ s!(http://swtch.com/plan9port/unix)!\1!g; + + open(OUT, ">$ARGV[$i]") || die "open $ARGV[$i]: $!"; + print OUT $text; + close OUT; +} + +exit 0;