[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#436436: "Max. results" is ignored when searching the "Application Manuals"



Package: khelpcenter
Version: 4:3.5.7-2
Tags: patch

When the "Application Manuals" box is checked, and "Max. results" is set to a value other than 10, a search in khelpcenter will still return only 10 matches (instead of the value from "Max. results") from the manuals even if more matches are available. On the other hand, searching "UNIX manual pages" does listen to the "Max. results" value. The reason is that khelpcenter uses htdig to search the manuals, and the $maxnum variable (i.e. what "Max. results" is set to) is never passed to htdig in khc_htsearch.pl . htdig's default is to provide only 10 results. The attached patch fixes khelpcenter on my system. (It also removes an occasional false result from the search: "[index.html]").

--
--- bin/khc_htsearch.pl	2007-08-07 15:06:54.919224578 +0300
+++ bin/khc_htsearch.pl	2007-08-07 15:11:45.047758061 +0300
@@ -42,7 +42,7 @@
 $words = encode( $charset, $words );
 
 if ( !open( HTSEARCH, "-|", "$htsearchpath", "-c", "$indexdir/$config.conf",
-            "format=$format&method=$method&words=$words" ) )
+            "format=$format&method=$method&words=$words&matchesperpage=$maxnum&exclude=[index.html]" ) )
 {
   print "Can't execute htsearch at '$htsearchpath'.\n";
   exit 1;

Reply to: