diff --git a/data/cgi/Makefile b/data/cgi/Makefile index 46c2abe605..165cf49740 100644 --- a/data/cgi/Makefile +++ b/data/cgi/Makefile @@ -1,10 +1,10 @@ -# $Id: Makefile,v 1.9 1997-10-11 15:58:11 wosch Exp $ +# $Id: Makefile,v 1.10 1998-02-26 23:49:47 jfieber Exp $ DATA= ftp.mirrors CGI= ftp.cgi gallery.cgi mirror.cgi cgi-lib.pl cgi-style.pl CGI+= search.cgi cvsweb.cgi query-pr.cgi query-pr-summary.cgi CGI+= dosendpr.cgi freebsd.def html.pl reg.cgi missing_handler.cgi -CGI+= ports.cgi pds.cgi man.cgi url.cgi +CGI+= ports.cgi pds.cgi man.cgi url.cgi getmsg.cgi .SUFFIXES: .C .cgi diff --git a/data/cgi/getmsg.cgi b/data/cgi/getmsg.cgi new file mode 100755 index 0000000000..d1d377c80e --- /dev/null +++ b/data/cgi/getmsg.cgi @@ -0,0 +1,92 @@ +#!/usr/local/bin/perl -T +# $Id: getmsg.cgi,v 1.1 1998-02-26 23:49:52 jfieber Exp $ + +require "./cgi-lib.pl"; +require "./cgi-style.pl"; + +my $messageroot = "/usr/local/www/db/text/"; +&ReadParse(*formdata); +&Fetch($formdata{'fetch'}); + +exit 0; + +sub Fetch +{ + local ($docid) = @_; + local ($start, $end, $file) = split(/ /, $docid); + print &short_html_header("FreeBSD Mail Archives"); + + # + # Check to ensure that (a) the specified file starts + # with an approved pathname and (b) that it contains no + # relative components (eg ..). This is so that arbitrary + # files cannot be accessed. + # + + $file =~ s/\.\.//g; + $file =~ s|/+|/|; + + if ($file =~ /^$messageroot/ && open(DATA, $file)) { + seek DATA, $start, 0; + read DATA, $message, $end - $start; + close(DATA); + print &MessageToHTML($message); + } else { + print "

The specified message cannot be accessed.

\n"; + } + + print &html_footer; + print "\n"; +} + +sub EscapeHTML +{ + local ($_) = @_; + s/&/&/g; + s//>/g; + return $_; +} + +sub MessageToHTML +{ + my ($doc) = @_; + my ($i, %hdr); + my ($header, $body) = split(/\n\n/, $doc, 2); + + $body = &EscapeHTML($body); + + $header = &EscapeHTML($header); + $header =~ s/\n */ /g; + + foreach $i (split(/\n/, $header)) { + ($field, $data) = split(/ /, $i, 2); + $hdr{$field} = $data; + } + + $message = "
\n";
+    if (length($hdr{'Date:'}) > 0) {
+    	$message .= "Date:      $hdr{'Date:'}\n";
+    }
+    if (length($hdr{'From:'}) > 0) {
+    	$message .= "From:      $hdr{'From:'}\n";
+    }
+    if (length($hdr{'To:'}) > 0) {
+    	$message .= "To:        $hdr{'To:'}\n";
+    }
+    if (length($hdr{'Cc:'}) > 0) {
+    	$message .= "Cc:        $hdr{'Cc:'}\n";
+    }
+#    if (length($hdr{'Sender:'}) > 0) {
+#    	$message .= "Sender:    $hdr{'Sender:'}\n";
+#    }
+    if (length($hdr{'Subject:'}) > 0) {
+    	$message .= "Subject:   $hdr{'Subject:'}\n";
+    }
+    $message .= "
\n"; + + $message .= "
\n$body\n
\n"; + + return $message; +} + diff --git a/data/cgi/search.cgi b/data/cgi/search.cgi index dcd439b83d..24da5a633c 100755 --- a/data/cgi/search.cgi +++ b/data/cgi/search.cgi @@ -1,4 +1,4 @@ -#!/usr/bin/perl +#!/usr/local/bin/perl # # mail-archive.pl -- a CGI interface to a wais indexed maling list archive. # @@ -30,7 +30,7 @@ require "cgi-style.pl"; sub do_wais { &ReadParse; - + @FORM_words = split(/ /, $in{"words"}); @FORM_source = split(/\0/, $in{"source"}); $FORM_max = $in{"max"}; @@ -60,8 +60,8 @@ sub do_wais { $i = join(", ", @FORM_source); $i =~ s/,([^,]*)$/ and $1/; print &html_header("Mail Archive Search") . - "

None of the archives you requested ($i) are available at " . - "this time.

\n"; + "

None of the archives you requested ($i) are " . + " available at this time.

\n"; print "

Please try again later, or return to the " . "search page and select a different archive.

\n"; print &html_footer; @@ -84,138 +84,111 @@ sub do_wais { :result-documents ( ) )\n"; - + # # First case, no document number so this is a regular search # - if (length($FORM_docnum) == 0) { - print &html_header("Search Results"); - print $availmsg; - if ($#AVAIL_source > 0) { - $src = join("
, ", @AVAIL_source); - $src =~ s/,([^,]*)$/ and $1/; - print "

The archives $src contain "; - } - else { - print "The archive @AVAIL_source contains "; - } - print " the following items relevant to \`@FORM_words\':\n"; - print "

    \n"; - - &open2(WAISOUT, WAISIN, $waisq, "-g"); - print WAISIN $w_question; - - local(@mylist) = (); - local($hits, $score, $headline, $lines, $bytes, $type, $date, $file); - while () { - /:score\s+(\d+)/ && ($score = $1); - /:filename "(.*)"/ && ($file = $1); - /:number-of-lines\s+(\d+)/ && ($lines = $1); - /:number-of-bytes\s+(\d+)/ && ($bytes = $1); - /:type "(.*)"/ && ($type = $1); - /:headline "(.*)"/ && ($headline = $1, - $headline =~ s/Re:\sRe:\s/Re: /); # XXX - /:date "(\d+)"/ && ($date = $1, $hits++, - push(@mylist, join("\t", $date, $headline, $type, - $bytes, $lines, $file, $score, $hits))); - } - - if ($in{'sort'} eq "date") { - foreach (reverse sort {$a <=> $b} @mylist) { - ($date, $headline, $type, $bytes, $lines, - $file, $score, $hits) = split("\t"); - &docdone; - } - } elsif ($in{'sort'} eq "subject") { - local(@a, @c, $b, $d); - foreach (@mylist) { - @a = split("\t"); - $b = $a[0]; - # swap date and subject - if ($a[1] =~ /(^[^:]+)(Re:.*)/) { - $a[0] = "$2\t$1"; - } else { - $a[0] = "$a[1]\t."; - } - $a[1] = $b; - push(@c, join("\t", @a)); - } - local($subject, $author); - foreach (sort {$a cmp $b} @c) { - ($subject, $author, $date, $type, $bytes, - $lines, $file, $score, $hits) = split("\t"); - $headline = $author . $subject; - &docdone; - } - - } elsif ($in{'sort'} eq "author") { - local(@a, @c, $b); - foreach (@mylist) { - @a = split("\t"); - # swap date and subject - $b = $a[0]; $a[0] = $a[1]; $a[1] = $b; - push(@c, join("\t", @a)); - } - foreach (sort {$a cmp $b} @c) { - ($headline, $date, $type, $bytes, - $lines, $file, $score, $hits) = split("\t"); - &docdone; - } - - } else { - foreach (@mylist) { - ($date, $headline, $type, $bytes, - $lines, $file, $score, $hits) = split("\t"); - &docdone; - } - } - #print qq[in: $in{'sort'}\n]; - - print "
\n"; - - print "

Didn't get what you expected? "; - print "Look here for searching hints.

"; - - if ($hits == 0) { - print "Nothing found.\n"; - } - - print &html_footer; - close(WAISOUT); - close(WAISIN); - - } - -# -# Second Case, a document number was supplied -# - - else { - print &short_html_header("Search Results"); - &open2(WAISOUT, WAISIN, $waisq, "-g"); - print WAISIN $w_question; - - while () { - s/search_word: boolean \`and\' scored//g; - $w_result .= $_; - } - close(WAISOUT); - close(WAISIN); - - &open2(WAISOUT, WAISIN, $waisq, "-m", $FORM_max, "-v", $FORM_docnum); - print WAISIN $w_result; - - while () { - $foo .= $_; - } - &printdoc($foo); - - print &html_footer; - close(WAISOUT); - close(WAISIN); + print &html_header("Search Results"); + print $availmsg; + if ($#AVAIL_source > 0) { + $src = join("
, ", @AVAIL_source); + $src =~ s/,([^,]*)$/ and $1/; + print "

The archives $src contain "; } -} + else { + print "The archive @AVAIL_source contains "; + } + print " the following items relevant to \`@FORM_words\':\n"; + print "

    \n"; + + &open2(WAISOUT, WAISIN, $waisq, "-g"); + print WAISIN $w_question; + + local(@mylist) = (); + local($hits, $score, $headline, $lines, $bytes, $docid, $date, $file); + print "
    ";
    +    while () {
    +	/:original-local-id.*#\(\s+([^\)]*)/ && 
    +	    ($docid = pack("C*", split(/\s+/, $1)),
    +	     $docid =~ s/\s+/+/g);
    +	/:score\s+(\d+)/ && ($score = $1);
    +	/:filename "(.*)"/ && ($file = $1);
    +	/:number-of-lines\s+(\d+)/ && ($lines = $1);
    +	/:number-of-bytes\s+(\d+)/ && ($bytes = $1);
    +	/:headline "(.*)"/ && ($headline = $1, 
    +			       $headline =~ s/[Rr]e://);  # XXX
    +	/:date "(\d+)"/ && ($date = $1, $hits++, 
    +			    push(@mylist, join("\t", $date, $headline, $docid, 
    +					       $bytes, $lines, $file, $score, $hits)));
    +    }
    +    print "
    "; + + if ($in{'sort'} eq "date") { + foreach (reverse sort {$a <=> $b} @mylist) { + ($date, $headline, $docid, $bytes, $lines, + $file, $score, $hits) = split("\t"); + &docdone; + } + } elsif ($in{'sort'} eq "subject") { + local(@a, @c, $b, $d); + foreach (@mylist) { + @a = split("\t"); + $b = $a[0]; + # swap date and subject + if ($a[1] =~ /(^[^:]+)(Re:.*)/) { + $a[0] = "$2\t$1"; + } else { + $a[0] = "$a[1]\t."; + } + $a[1] = $b; + push(@c, join("\t", @a)); + } + local($subject, $author); + foreach (sort {$a cmp $b} @c) { + ($subject, $author, $date, $docid, $bytes, + $lines, $file, $score, $hits) = split("\t"); + $headline = $author . $subject; + &docdone; + } + + } elsif ($in{'sort'} eq "author") { + local(@a, @c, $b); + foreach (@mylist) { + @a = split("\t"); + # swap date and subject + $b = $a[0]; $a[0] = $a[1]; $a[1] = $b; + push(@c, join("\t", @a)); + } + foreach (sort {$a cmp $b} @c) { + ($headline, $date, $docid, $bytes, + $lines, $file, $score, $hits) = split("\t"); + &docdone; + } + + } else { + foreach (@mylist) { + ($date, $headline, $docid, $bytes, + $lines, $file, $score, $hits) = split("\t"); + &docdone; + } + } + #print qq[in: $in{'sort'}\n]; + + print "
\n"; + + print "

Didn't get what you expected? "; + print "Look here for searching hints.

"; + + if ($hits == 0) { + print "Nothing found.\n"; + } + + print &html_footer; + close(WAISOUT); + close(WAISIN); + +} # Given an array of sources (sans .src extension), this routine # checks to see if they actually exist, and if they do, if they @@ -237,49 +210,6 @@ sub checksource { return(@goodsources); } - -# Print a mail message in HTML form - -sub printdoc { - local ($doc) = @_; - - ($header, $body) = split(/\n\n/, $doc, 2); - - $body = &htmlescape($body); - - $header = &htmlescape($header); - $header =~ s/\n */ /g; - - foreach $i (split(/\n/, $header)) { - ($field, $data) = split(/ /, $i, 2); - $field =~ y/A-Z/a-z/; - $hdr{$field} = $data; - } - - print "\n
\n";
-    if (length($hdr{'date:'}) > 0) {
-    	print "Date:      $hdr{'date:'}\n";
-    }
-    if (length($hdr{'from:'}) > 0) {
-    	print "From:      $hdr{'from:'}\n";
-    }
-    if (length($hdr{'to:'}) > 0) {
-    	print "To:        $hdr{'to:'}\n";
-    }
-    if (length($hdr{'cc:'}) > 0) {
-    	print "Cc:        $hdr{'cc:'}\n";
-    }
-    if (length($hdr{'sender:'}) > 0) {
-    	print "Sender:    $hdr{'sender:'}\n";
-    }
-    if (length($hdr{'subject:'}) > 0) {
-    	print "Subject:   $hdr{'subject:'}\n";
-    }
-    print "
\n"; - - print "
\n$body\n
\n"; -} - sub htmlescape { local ($data) = @_; $data =~ s/&/&/g; @@ -297,7 +227,7 @@ sub docdone { if ($file eq "www") { print "
  • $headline\n"; } else { - print "
  • $headline\n"; + print "
  • $headline\n"; } print "
    "; # print ""; @@ -309,7 +239,7 @@ sub docdone { print "Archive: $file"; print "

  • \n"; } - $score = $headline = $lines = $bytes = $type = $date = $file = ''; +# $score = $headline = $lines = $bytes = $docid = $date = $file = ''; } $| = 1; diff --git a/en/cgi/Makefile b/en/cgi/Makefile index 46c2abe605..165cf49740 100644 --- a/en/cgi/Makefile +++ b/en/cgi/Makefile @@ -1,10 +1,10 @@ -# $Id: Makefile,v 1.9 1997-10-11 15:58:11 wosch Exp $ +# $Id: Makefile,v 1.10 1998-02-26 23:49:47 jfieber Exp $ DATA= ftp.mirrors CGI= ftp.cgi gallery.cgi mirror.cgi cgi-lib.pl cgi-style.pl CGI+= search.cgi cvsweb.cgi query-pr.cgi query-pr-summary.cgi CGI+= dosendpr.cgi freebsd.def html.pl reg.cgi missing_handler.cgi -CGI+= ports.cgi pds.cgi man.cgi url.cgi +CGI+= ports.cgi pds.cgi man.cgi url.cgi getmsg.cgi .SUFFIXES: .C .cgi diff --git a/en/cgi/getmsg.cgi b/en/cgi/getmsg.cgi new file mode 100755 index 0000000000..d1d377c80e --- /dev/null +++ b/en/cgi/getmsg.cgi @@ -0,0 +1,92 @@ +#!/usr/local/bin/perl -T +# $Id: getmsg.cgi,v 1.1 1998-02-26 23:49:52 jfieber Exp $ + +require "./cgi-lib.pl"; +require "./cgi-style.pl"; + +my $messageroot = "/usr/local/www/db/text/"; +&ReadParse(*formdata); +&Fetch($formdata{'fetch'}); + +exit 0; + +sub Fetch +{ + local ($docid) = @_; + local ($start, $end, $file) = split(/ /, $docid); + print &short_html_header("FreeBSD Mail Archives"); + + # + # Check to ensure that (a) the specified file starts + # with an approved pathname and (b) that it contains no + # relative components (eg ..). This is so that arbitrary + # files cannot be accessed. + # + + $file =~ s/\.\.//g; + $file =~ s|/+|/|; + + if ($file =~ /^$messageroot/ && open(DATA, $file)) { + seek DATA, $start, 0; + read DATA, $message, $end - $start; + close(DATA); + print &MessageToHTML($message); + } else { + print "

    The specified message cannot be accessed.

    \n"; + } + + print &html_footer; + print "\n"; +} + +sub EscapeHTML +{ + local ($_) = @_; + s/&/&/g; + s//>/g; + return $_; +} + +sub MessageToHTML +{ + my ($doc) = @_; + my ($i, %hdr); + my ($header, $body) = split(/\n\n/, $doc, 2); + + $body = &EscapeHTML($body); + + $header = &EscapeHTML($header); + $header =~ s/\n */ /g; + + foreach $i (split(/\n/, $header)) { + ($field, $data) = split(/ /, $i, 2); + $hdr{$field} = $data; + } + + $message = "
    \n";
    +    if (length($hdr{'Date:'}) > 0) {
    +    	$message .= "Date:      $hdr{'Date:'}\n";
    +    }
    +    if (length($hdr{'From:'}) > 0) {
    +    	$message .= "From:      $hdr{'From:'}\n";
    +    }
    +    if (length($hdr{'To:'}) > 0) {
    +    	$message .= "To:        $hdr{'To:'}\n";
    +    }
    +    if (length($hdr{'Cc:'}) > 0) {
    +    	$message .= "Cc:        $hdr{'Cc:'}\n";
    +    }
    +#    if (length($hdr{'Sender:'}) > 0) {
    +#    	$message .= "Sender:    $hdr{'Sender:'}\n";
    +#    }
    +    if (length($hdr{'Subject:'}) > 0) {
    +    	$message .= "Subject:   $hdr{'Subject:'}\n";
    +    }
    +    $message .= "
    \n"; + + $message .= "
    \n$body\n
    \n"; + + return $message; +} + diff --git a/en/cgi/search.cgi b/en/cgi/search.cgi index dcd439b83d..24da5a633c 100755 --- a/en/cgi/search.cgi +++ b/en/cgi/search.cgi @@ -1,4 +1,4 @@ -#!/usr/bin/perl +#!/usr/local/bin/perl # # mail-archive.pl -- a CGI interface to a wais indexed maling list archive. # @@ -30,7 +30,7 @@ require "cgi-style.pl"; sub do_wais { &ReadParse; - + @FORM_words = split(/ /, $in{"words"}); @FORM_source = split(/\0/, $in{"source"}); $FORM_max = $in{"max"}; @@ -60,8 +60,8 @@ sub do_wais { $i = join("
    , ", @FORM_source); $i =~ s/,([^,]*)$/ and $1/; print &html_header("Mail Archive Search") . - "

    None of the archives you requested ($i) are available at " . - "this time.

    \n"; + "

    None of the archives you requested ($i) are " . + " available at this time.

    \n"; print "

    Please try again later, or return to the " . "search page and select a different archive.

    \n"; print &html_footer; @@ -84,138 +84,111 @@ sub do_wais { :result-documents ( ) )\n"; - + # # First case, no document number so this is a regular search # - if (length($FORM_docnum) == 0) { - print &html_header("Search Results"); - print $availmsg; - if ($#AVAIL_source > 0) { - $src = join("
    , ", @AVAIL_source); - $src =~ s/,([^,]*)$/ and $1/; - print "

    The archives $src contain "; - } - else { - print "The archive @AVAIL_source contains "; - } - print " the following items relevant to \`@FORM_words\':\n"; - print "

      \n"; - - &open2(WAISOUT, WAISIN, $waisq, "-g"); - print WAISIN $w_question; - - local(@mylist) = (); - local($hits, $score, $headline, $lines, $bytes, $type, $date, $file); - while () { - /:score\s+(\d+)/ && ($score = $1); - /:filename "(.*)"/ && ($file = $1); - /:number-of-lines\s+(\d+)/ && ($lines = $1); - /:number-of-bytes\s+(\d+)/ && ($bytes = $1); - /:type "(.*)"/ && ($type = $1); - /:headline "(.*)"/ && ($headline = $1, - $headline =~ s/Re:\sRe:\s/Re: /); # XXX - /:date "(\d+)"/ && ($date = $1, $hits++, - push(@mylist, join("\t", $date, $headline, $type, - $bytes, $lines, $file, $score, $hits))); - } - - if ($in{'sort'} eq "date") { - foreach (reverse sort {$a <=> $b} @mylist) { - ($date, $headline, $type, $bytes, $lines, - $file, $score, $hits) = split("\t"); - &docdone; - } - } elsif ($in{'sort'} eq "subject") { - local(@a, @c, $b, $d); - foreach (@mylist) { - @a = split("\t"); - $b = $a[0]; - # swap date and subject - if ($a[1] =~ /(^[^:]+)(Re:.*)/) { - $a[0] = "$2\t$1"; - } else { - $a[0] = "$a[1]\t."; - } - $a[1] = $b; - push(@c, join("\t", @a)); - } - local($subject, $author); - foreach (sort {$a cmp $b} @c) { - ($subject, $author, $date, $type, $bytes, - $lines, $file, $score, $hits) = split("\t"); - $headline = $author . $subject; - &docdone; - } - - } elsif ($in{'sort'} eq "author") { - local(@a, @c, $b); - foreach (@mylist) { - @a = split("\t"); - # swap date and subject - $b = $a[0]; $a[0] = $a[1]; $a[1] = $b; - push(@c, join("\t", @a)); - } - foreach (sort {$a cmp $b} @c) { - ($headline, $date, $type, $bytes, - $lines, $file, $score, $hits) = split("\t"); - &docdone; - } - - } else { - foreach (@mylist) { - ($date, $headline, $type, $bytes, - $lines, $file, $score, $hits) = split("\t"); - &docdone; - } - } - #print qq[in: $in{'sort'}\n]; - - print "
    \n"; - - print "

    Didn't get what you expected? "; - print "Look here for searching hints.

    "; - - if ($hits == 0) { - print "Nothing found.\n"; - } - - print &html_footer; - close(WAISOUT); - close(WAISIN); - - } - -# -# Second Case, a document number was supplied -# - - else { - print &short_html_header("Search Results"); - &open2(WAISOUT, WAISIN, $waisq, "-g"); - print WAISIN $w_question; - - while () { - s/search_word: boolean \`and\' scored//g; - $w_result .= $_; - } - close(WAISOUT); - close(WAISIN); - - &open2(WAISOUT, WAISIN, $waisq, "-m", $FORM_max, "-v", $FORM_docnum); - print WAISIN $w_result; - - while () { - $foo .= $_; - } - &printdoc($foo); - - print &html_footer; - close(WAISOUT); - close(WAISIN); + print &html_header("Search Results"); + print $availmsg; + if ($#AVAIL_source > 0) { + $src = join("
    , ", @AVAIL_source); + $src =~ s/,([^,]*)$/ and $1/; + print "

    The archives $src contain "; } -} + else { + print "The archive @AVAIL_source contains "; + } + print " the following items relevant to \`@FORM_words\':\n"; + print "

      \n"; + + &open2(WAISOUT, WAISIN, $waisq, "-g"); + print WAISIN $w_question; + + local(@mylist) = (); + local($hits, $score, $headline, $lines, $bytes, $docid, $date, $file); + print "
      ";
      +    while () {
      +	/:original-local-id.*#\(\s+([^\)]*)/ && 
      +	    ($docid = pack("C*", split(/\s+/, $1)),
      +	     $docid =~ s/\s+/+/g);
      +	/:score\s+(\d+)/ && ($score = $1);
      +	/:filename "(.*)"/ && ($file = $1);
      +	/:number-of-lines\s+(\d+)/ && ($lines = $1);
      +	/:number-of-bytes\s+(\d+)/ && ($bytes = $1);
      +	/:headline "(.*)"/ && ($headline = $1, 
      +			       $headline =~ s/[Rr]e://);  # XXX
      +	/:date "(\d+)"/ && ($date = $1, $hits++, 
      +			    push(@mylist, join("\t", $date, $headline, $docid, 
      +					       $bytes, $lines, $file, $score, $hits)));
      +    }
      +    print "
      "; + + if ($in{'sort'} eq "date") { + foreach (reverse sort {$a <=> $b} @mylist) { + ($date, $headline, $docid, $bytes, $lines, + $file, $score, $hits) = split("\t"); + &docdone; + } + } elsif ($in{'sort'} eq "subject") { + local(@a, @c, $b, $d); + foreach (@mylist) { + @a = split("\t"); + $b = $a[0]; + # swap date and subject + if ($a[1] =~ /(^[^:]+)(Re:.*)/) { + $a[0] = "$2\t$1"; + } else { + $a[0] = "$a[1]\t."; + } + $a[1] = $b; + push(@c, join("\t", @a)); + } + local($subject, $author); + foreach (sort {$a cmp $b} @c) { + ($subject, $author, $date, $docid, $bytes, + $lines, $file, $score, $hits) = split("\t"); + $headline = $author . $subject; + &docdone; + } + + } elsif ($in{'sort'} eq "author") { + local(@a, @c, $b); + foreach (@mylist) { + @a = split("\t"); + # swap date and subject + $b = $a[0]; $a[0] = $a[1]; $a[1] = $b; + push(@c, join("\t", @a)); + } + foreach (sort {$a cmp $b} @c) { + ($headline, $date, $docid, $bytes, + $lines, $file, $score, $hits) = split("\t"); + &docdone; + } + + } else { + foreach (@mylist) { + ($date, $headline, $docid, $bytes, + $lines, $file, $score, $hits) = split("\t"); + &docdone; + } + } + #print qq[in: $in{'sort'}\n]; + + print "
    \n"; + + print "

    Didn't get what you expected? "; + print "Look here for searching hints.

    "; + + if ($hits == 0) { + print "Nothing found.\n"; + } + + print &html_footer; + close(WAISOUT); + close(WAISIN); + +} # Given an array of sources (sans .src extension), this routine # checks to see if they actually exist, and if they do, if they @@ -237,49 +210,6 @@ sub checksource { return(@goodsources); } - -# Print a mail message in HTML form - -sub printdoc { - local ($doc) = @_; - - ($header, $body) = split(/\n\n/, $doc, 2); - - $body = &htmlescape($body); - - $header = &htmlescape($header); - $header =~ s/\n */ /g; - - foreach $i (split(/\n/, $header)) { - ($field, $data) = split(/ /, $i, 2); - $field =~ y/A-Z/a-z/; - $hdr{$field} = $data; - } - - print "\n
    \n";
    -    if (length($hdr{'date:'}) > 0) {
    -    	print "Date:      $hdr{'date:'}\n";
    -    }
    -    if (length($hdr{'from:'}) > 0) {
    -    	print "From:      $hdr{'from:'}\n";
    -    }
    -    if (length($hdr{'to:'}) > 0) {
    -    	print "To:        $hdr{'to:'}\n";
    -    }
    -    if (length($hdr{'cc:'}) > 0) {
    -    	print "Cc:        $hdr{'cc:'}\n";
    -    }
    -    if (length($hdr{'sender:'}) > 0) {
    -    	print "Sender:    $hdr{'sender:'}\n";
    -    }
    -    if (length($hdr{'subject:'}) > 0) {
    -    	print "Subject:   $hdr{'subject:'}\n";
    -    }
    -    print "
    \n"; - - print "
    \n$body\n
    \n"; -} - sub htmlescape { local ($data) = @_; $data =~ s/&/&/g; @@ -297,7 +227,7 @@ sub docdone { if ($file eq "www") { print "
  • $headline\n"; } else { - print "
  • $headline\n"; + print "
  • $headline\n"; } print "
    "; # print ""; @@ -309,7 +239,7 @@ sub docdone { print "Archive: $file"; print "

  • \n"; } - $score = $headline = $lines = $bytes = $type = $date = $file = ''; +# $score = $headline = $lines = $bytes = $docid = $date = $file = ''; } $| = 1;