Commit 53a10ddc authored by Benno Schulenberg's avatar Benno Schulenberg
Browse files

tweaks: elide an unneeded variable

A shortcut's function must be among the existing ones, otherwise
nano's code is fundamentally broken.
No related merge requests found
Showing with 1 addition and 3 deletions
+1 -3
......@@ -64,7 +64,6 @@ int do_statusbar_input(bool *finished)
static size_t kbinput_len = 0;
/* The length of the input buffer. */
const sc *shortcut;
const subnfunc *f;
*finished = FALSE;
......@@ -168,8 +167,7 @@ int do_statusbar_input(bool *finished)
/* Handle any other shortcut in the current menu, setting finished
* to TRUE to indicate that we're done after running or trying to
* run its associated function. */
f = sctofunc(shortcut);
if (f && (!ISSET(VIEW_MODE) || f->viewok))
if (!ISSET(VIEW_MODE) || sctofunc(shortcut)->viewok)
execute(shortcut);
*finished = TRUE;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment