]> granicus.if.org Git - mutt/commitdiff
Stable branch quick fix for pager change-mailbox push/exec bug. stable
authorKevin McCarthy <kevin@8t8.us>
Thu, 17 Oct 2019 07:48:31 +0000 (15:48 +0800)
committerKevin McCarthy <kevin@8t8.us>
Thu, 17 Oct 2019 07:48:31 +0000 (15:48 +0800)
The menu functions mutt_push/pop_current_menu() keep track of the menu
stack, automatically setting CurrentMenu when exiting menus.

The only gotcha was the function sharing between the index and pager
menus.  The index uses a hack, setting menu->menu to MENU_PAGER for
operations redirecting through the index and back to the pager
afterwards.

I thought this was covered by the restoration of the menu before
returning to the pager, or when exiting the index switch.  However it
is not: invoking other menus, such as the browser, will result in
CurrentMenu being set to the Pager when exiting those (by
mutt_pop_current_menu()).  This can result in folder hooks failing for
unshared functions.

A better fix is to remove the hack of using menu->menu, because this
can easily cause a problem in the future in other situations.  (I will
make this fix in master next.)  For the stable branch, I am explicitly
setting/restoring CurrentMenu before invoking the folder hooks.

curs_main.c

index 32925f29d7d8d4b6ac019248a7728acbda6fc808..d57ce985dfb67a7c28b0335e81be84d1a471be23 100644 (file)
@@ -1371,6 +1371,9 @@ int mutt_index_menu (void)
 
         mutt_sleep (0);
 
+        /* XXX: quick fix in stable branch.  Better fix will be in master */
+        CurrentMenu = MENU_MAIN;
+
         /* Note that menu->menu may be MENU_PAGER if the change folder
          * operation originated from the pager.
          *