]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
kconfig: lxdialog: fix 'space' to (de)select options
authorYann E. MORIN <yann.morin.1998@free.fr>
Wed, 13 Nov 2013 23:53:32 +0000 (00:53 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 28 Aug 2025 14:28:29 +0000 (16:28 +0200)
[ Upstream commit 694174f94ebeeb5ec5cc0e9de9b40c82057e1d95 ]

In case a menu has comment without letters/numbers (eg. characters
matching the regexp '^[^[:alpha:][:digit:]]+$', for example - or *),
hitting space will cycle through those comments, rather than
selecting/deselecting the currently-highlighted option.

This is the behaviour of hitting any letter/digit: jump to the next
option which prompt starts with that letter. The only letters that
do not behave as such are 'y' 'm' and 'n'. Prompts that start with
one of those three letters are instead matched on the first letter
that is not 'y', 'm' or 'n'.

Fix that by treating 'space' as we treat y/m/n, ie. as an action key,
not as shortcut to jump to  prompt.

Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
Signed-off-by: Cherniaev Andrei <dungeonlords789@naver.com>
[masahiro: took from Buildroot, adjusted the commit subject]
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
scripts/kconfig/lxdialog/menubox.c

index 0e333284e947bcf35b1c69043d83df205e8e98f7..6bb8a320a4cb8dc2d2a62cad66edc7b6654b9303 100644 (file)
@@ -264,7 +264,7 @@ do_resize:
                if (key < 256 && isalpha(key))
                        key = tolower(key);
 
-               if (strchr("ynmh", key))
+               if (strchr("ynmh ", key))
                        i = max_choice;
                else {
                        for (i = choice + 1; i < max_choice; i++) {