From 3b031b1bade1706115e87c29c82a1d4dc2267939 Mon Sep 17 00:00:00 2001
From: Benno Schulenberg <bensberg@justemail.net>
Date: Tue, 1 Jul 2014 08:38:08 +0000
Subject: [PATCH] Making sure to always set 'currmenu', so that we can rely on
 it.

git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5042 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
---
 ChangeLog     | 4 ++++
 src/browser.c | 4 ----
 src/help.c    | 6 ------
 3 files changed, 4 insertions(+), 10 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index d1d37ca0..b6c5ee86 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2014-07-01  Benno Schulenberg  <bensberg@justemail.net>
+	* src/browser.c (do_browser), src/help.c (do_help): Make sure
+	to always set 'currmenu', so that we can rely on it.
+
 2014-06-30  Mark Majeres  <mark@engine12.com>
 	* src/cut.c, src/global.c, src/nano.c: Rename 'cut_till_end' to
 	'cut_till_eof', and 'do_cut_till_end' to 'do_cut_till_eof', to
diff --git a/src/browser.c b/src/browser.c
index 8d1d5eba..703a0dc1 100644
--- a/src/browser.c
+++ b/src/browser.c
@@ -63,9 +63,7 @@ char *do_browser(char *path, DIR *dir)
 
     curs_set(0);
     blank_statusbar();
-#if !defined(DISABLE_HELP) || !defined(DISABLE_MOUSE)
     currmenu = MBROWSER;
-#endif
     bottombars(MBROWSER);
     wnoutrefresh(bottomwin);
 
@@ -211,9 +209,7 @@ char *do_browser(char *path, DIR *dir)
 			browser_refresh, _("Go To Directory"));
 
 	    curs_set(0);
-#if !defined(DISABLE_HELP) || !defined(DISABLE_MOUSE)
 	    currmenu = MBROWSER;
-#endif
 	    bottombars(MBROWSER);
 
 	    /* If the directory begins with a newline (i.e. an
diff --git a/src/help.c b/src/help.c
index 6b5b97f3..828badca 100644
--- a/src/help.c
+++ b/src/help.c
@@ -44,10 +44,8 @@ void do_help(void (*refresh_func)(void))
     size_t last_line = 0;
 	/* The line number in help_text of the last help line.  This
 	 * variable is zero-based. */
-#ifndef DISABLE_MOUSE
     int oldmenu = currmenu;
 	/* The menu we were called from. */
-#endif
     const char *ptr;
 	/* The current line of the help text. */
     size_t old_line = (size_t)-1;
@@ -64,11 +62,9 @@ void do_help(void (*refresh_func)(void))
 
     assert(help_text != NULL);
 
-#ifndef DISABLE_MOUSE
     /* Set currmenu to allow clicking on the help screen's shortcut
      * list, after help_init() is called. */
     currmenu = MHELP;
-#endif
 
     if (ISSET(NO_HELP)) {
 	/* Make sure that the help screen's shortcut list will actually
@@ -168,9 +164,7 @@ void do_help(void (*refresh_func)(void))
 	}
     }
 
-#ifndef DISABLE_MOUSE
     currmenu = oldmenu;
-#endif
 
     if (old_no_help) {
 	blank_bottombars();
-- 
GitLab