Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

kconfig: lxdialog: fix 'space' to (de)select options

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>

authored by

Yann E. MORIN and committed by
Masahiro Yamada
694174f9 0a1eab12

+1 -1
+1 -1
scripts/kconfig/lxdialog/menubox.c
··· 264 264 if (key < 256 && isalpha(key)) 265 265 key = tolower(key); 266 266 267 - if (strchr("ynmh", key)) 267 + if (strchr("ynmh ", key)) 268 268 i = max_choice; 269 269 else { 270 270 for (i = choice + 1; i < max_choice; i++) {