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
This commit is contained in:
Benno Schulenberg 2014-07-01 08:38:08 +00:00
parent 95e77a9d5f
commit 3b031b1bad
3 changed files with 4 additions and 10 deletions

View File

@ -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

View File

@ -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

View File

@ -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();