X-Git-Url: http://git.i-scream.org/?a=blobdiff_plain;f=cgi-bin%2Fdocs.cgi;h=479adc995d23bdcee3180bc504dddbf41d61c8e5;hb=6567070dd93dd5ce4196d04dd15c588080b5b604;hp=bdcd3f9721a02bd3b757ddde93c58248f82bf44a;hpb=4399a59c122c1a3cb239361f6d437732e16653e2;p=www.i-scream.org.git diff --git a/cgi-bin/docs.cgi b/cgi-bin/docs.cgi index bdcd3f9..479adc9 100755 --- a/cgi-bin/docs.cgi +++ b/cgi-bin/docs.cgi @@ -98,7 +98,7 @@ END exit 0; # Print a file, whilst escaping HTML: - -sub print_file ($) { +sub print_file { my ($urls) = '(' . join ('|', qw{ http telnet @@ -109,32 +109,36 @@ my ($urls) = '(' . join ('|', qw{ } ) . ')'; -my ($ltrs) = '\w'; -my ($gunk) = '/#~:.?+=&%@!\-'; -my ($punc) = '.:?\-'; -my ($any) = "${ltrs}${gunk}${punc}"; -my ($filename) = @_; -if(open(FILE, $filename)) { - print "
\n";
-    # Use $_ implicitly throughout.
-    while () {
-        # Must do the next line first!
-        s/&/&/g;
-        s//>/g;
-        s/"/"/g;
-        s/\b($urls:[$any]+?)(?=[$punc]*[^$any]|$)/$1<\/a>/igox;
-        print;
+    my ($ltrs) = '\w';
+    my ($gunk) = '/#~:.?+=&%@!\-';
+    my ($punc) = '.:?\-';
+    my ($any) = "${ltrs}${gunk}${punc}";
+    my ($filename) = @_;
+    if(open(FILE, $filename)) {
+        print "          
\n";
+        # Use $_ implicitly throughout.
+        while () {
+            # Must do the next line first!
+            s/&/&/g;
+            s//>/g;
+            s/"/"/g;
+            s/\b($urls:[$any]+?)(?=[$punc]*[^$any]|$)/$1<\/a>/igox;
+            print;
+        }
+        print "\n
"; + } + else { + print "Failed to open $docname."; } - print "\n
"; -} -else { - print "Failed to open $docname."; -} } -# Print a file without escaping HTML: - +# Print the contents of a file containing html sub print_html ($) { -my ($filename) = @_; -print `cat $filename 2>&1`; + my ($filename) = @_; + open(FILE, $filename); + while() { + print; + } + close FILE; }