Package: menu
Version: 2.1.25

Attached is a fix that makes sure total_menuentries is correctly calculated. 
What it does is reset menuentries to 0 upon each directory scan, rather than 
let it accumulate and then add up times and again to total_menuentries.

I did not encounter any side-effects other than incorrect reporting in the -v 
output.

Regards,

        Shlomi Fish

---------------------------------------------------------------------
Shlomi Fish      [EMAIL PROTECTED]
Homepage:        http://www.shlomifish.org/

Tcl is LISP on drugs. Using strings instead of S-expressions for closures
is Evil with one of those gigantic E's you can find at the beginning of 
paragraphs.
--- update-menus/update-menus.cc.orig	2005-02-24 18:00:58.000000000 +0200
+++ update-menus/update-menus.cc	2005-06-21 21:29:32.794726240 +0300
@@ -541,11 +541,14 @@
 /** Read a directory full of menu files */
 void read_menufilesdir(vector<string> &menudata)
 {
-  int menuentries = 0;
+  int menuentries;
   for(vector<string>::const_iterator method_i = config.menufilesdir.begin();
       method_i != config.menufilesdir.end();
       ++method_i)
   {
+    // menuentries should be initialized to 0 at the beginning of every loop
+    // iteration, because otherwise it accumulates
+    menuentries = 0;
     string dirname = *method_i;
     config.report(String::compose(_("Reading menu-entry files in %1."), dirname),
         configinfo::report_verbose);

Reply via email to