From 2b1bc6866a7be5160d03201192c50accd8722f1c Mon Sep 17 00:00:00 2001 From: Benno Schulenberg Date: Wed, 21 Dec 2016 17:07:04 +0100 Subject: [PATCH] input: don't crash when receiving a KEY_CANCEL On some systems, typing ^C apparently results in a KEY_CANCEL in the input stream, which gets hard-bound to the do_cancel function. But in the main menu there is no Cancel function. So... in that case, let it fall back to the plain old Ctrl-C code: 0x03. Reported-by: Liam Gretton --- src/winio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/winio.c b/src/winio.c index 7237b8ac..8a5d70a3 100644 --- a/src/winio.c +++ b/src/winio.c @@ -667,7 +667,7 @@ int parse_kbinput(WINDOW *win) #endif /* Slang doesn't support KEY_CANCEL. */ case KEY_CANCEL: - return first_sc_for(currmenu, do_cancel)->keycode; + return sc_seq_or(do_cancel, 0x03); #endif #ifdef KEY_SUSPEND #ifdef KEY_SSUSPEND