From 6f64ed90edaf2def08d7b429562656a7f551d372 Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Sun, 8 Sep 2024 20:27:17 +0300 Subject: [PATCH] Curses: prevent menu search without menu options First noticed this when watching someone livestream, and managed to figure it out from there: The window that pops up when looking at a pile of objects under you by pressing ':' is marked as a menu, but has no selectable options. Curses still allowed you to use the menu-search command (':') on it. Prevent the menu search command in windows with no selectable entries. --- win/curses/cursdial.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/win/curses/cursdial.c b/win/curses/cursdial.c index d02f8a22a..5dbe9d796 100644 --- a/win/curses/cursdial.c +++ b/win/curses/cursdial.c @@ -1444,6 +1444,9 @@ curs_nonselect_menu_action( case MENU_SEARCH: { char search_key[BUFSZ]; + if (how == PICK_NONE) + break; + search_key[0] = '\0'; curses_line_input_dialog("Search for:", search_key, BUFSZ);