From 72f72d64a422d6628c4796f5c0bf2e508f134214 Mon Sep 17 00:00:00 2001 From: Tatsuya Kinoshita Date: Wed, 4 May 2011 16:05:14 +0900 Subject: Adding upstream version 0.5.1 --- scripts/w3mman/w3mman2html.cgi.in | 274 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 274 insertions(+) create mode 100644 scripts/w3mman/w3mman2html.cgi.in (limited to 'scripts/w3mman/w3mman2html.cgi.in') diff --git a/scripts/w3mman/w3mman2html.cgi.in b/scripts/w3mman/w3mman2html.cgi.in new file mode 100644 index 0000000..f41d487 --- /dev/null +++ b/scripts/w3mman/w3mman2html.cgi.in @@ -0,0 +1,274 @@ +#!@PERL@ + +$MAN = $ENV{'W3MMAN_MAN'} || '@MAN@'; +$QUERY = $ENV{'QUERY_STRING'} || $ARGV[0]; +$SCRIPT_NAME = $ENV{'SCRIPT_NAME'} || $0; +$CGI = "file://$SCRIPT_NAME"; +$CGI2 = "file:"; +# $CGI2 = "file:///\$LIB/hlink.cgi?"; +$SQUEEZE = 1; +$ENV{'PAGER'} = 'cat'; + +if ($QUERY =~ /\=/) { + for (split('&', $QUERY)) { + ($v, $q) = split('=', $_, 2); + $query{$v} = &form_decode($q); + } +} else { + $QUERY =~ s/^man=//; + $query{"man"} = &form_decode($QUERY); +} + +if (! $query{"man"}) { + if ($query{"keyword"}) { + $keyword = $query{"keyword"}; + $k = &html_quote($keyword); + print < +man -k $k + +

man -k $k

+