From: Ken Coar Date: Wed, 4 Jun 1997 00:31:23 +0000 (+0000) Subject: Fixed a Perl misteak (used "leave" instead of "last" - too X-Git-Tag: 1.2.1~5 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bff9c8779a4f1c4c76648a437501b06951e1e5b3;p=thirdparty%2Fapache%2Fhttpd.git Fixed a Perl misteak (used "leave" instead of "last" - too much BLISS lately.. ;-). git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@78216 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/docs/manual/search/manual-index.cgi b/docs/manual/search/manual-index.cgi index e4fa41ad0a4..8d06e8a1158 100644 --- a/docs/manual/search/manual-index.cgi +++ b/docs/manual/search/manual-index.cgi @@ -157,65 +157,67 @@ EOHT # closure code. # QUERY: - if ($word) { - # - # Try and open the index file; complain bitterly if we can't. - # - if (! open (INDEX, "<$INDEX")) { - printf ("Can't find documentation index!"); - leave QUERY; + { + if ($word) { + # + # Try and open the index file; complain bitterly if we can't. + # + if (! open (INDEX, "<$INDEX")) { + printf ("Can't find documentation index!"); + last QUERY; + } + # + # Got it; display the search-results header. + # + printf ($HTML); + # + # Read the entire index in and turn it into an hash for the + # lookup. + # + @index = ; + close (INDEX); + chomp (@index); + foreach (@index) { + ($key, $files) = split (/:/, $_); + $Index{$key} = $files; + } + # + # The dictionary is all lowercase words. Smash our query value + # and try to find it. + # + $word = lc ($word); + if (! exists ($Index{$word})) { + printf ("

\n Sorry, no matches found.\n

\n"); + last QUERY; + } + # + # Found an entry, so turn the hash value (a comma-separated list + # of relative file names) into an array for display. + # Incidentally, tell the user how many there are. + # + @files = split (/,/, $Index{$word}); + printf ("

Total of %d match", scalar (@files)); + # + # Be smart about plurals. + # + if (scalar (@files) != 1) { + printf ("es") ; + } + printf (" found.\n

\n"); + # + # Right. Now display the files as they're listed. + # + printf ("
    \n"); + foreach (@files) { + printf ("
  1. "); + printf ("$_\n"); + printf ("
  2. \n"); + } + printf ("
\n"); + # + # C'est tout! + # } - # - # Got it; display the search-results header. - # - printf ($HTML); - # - # Read the entire index in and turn it into an hash for the - # lookup. - # - @index = ; - close (INDEX); - chomp (@index); - foreach (@index) { - ($key, $files) = split (/:/, $_); - $Index{$key} = $files; - } - # - # The dictionary is all lowercase words. Smash our query value - # and try to find it. - # - $word = lc ($word); - if (! exists ($Index{$word})) { - printf ("

\n Sorry, no matches found.\n

\n"); - leave QUERY; - } - # - # Found an entry, so turn the hash value (a comma-separated list - # of relative file names) into an array for display. - # Incidentally, tell the user how many there are. - # - @files = split (/,/, $Index{$word}); - printf ("

Total of %d match", scalar (@files)); - # - # Be smart about plurals. - # - if (scalar (@files) != 1) { - printf ("es") ; - } - printf (" found.\n

\n"); - # - # Right. Now display the files as they're listed. - # - printf ("
    \n"); - foreach (@files) { - printf ("
  1. "); - printf ("$_\n"); - printf ("
  2. \n"); - } - printf ("
\n"); - # - # C'est tout! - # } #