From 063f4661fde8c03c4c03f8a205071a52691c152e Mon Sep 17 00:00:00 2001 From: Dirk Gouders Date: Sun, 19 May 2013 21:48:44 +0200 Subject: mconf: handle keys in empty dialogs When entering an empty dialog, using the movement keys resulted in unexpected characters beeing displayed, other keys like "z" and "h" did not work as expected. This patch handles the movement keys as well as other keys, especially "z", "h" and "/". Signed-off-by: Dirk Gouders [yann.morin.1998@free.fr: keep lines <80 chars, so reorder test] Tested-by: "Yann E. MORIN" Reviewed-by: "Yann E. MORIN" Signed-off-by: "Yann E. MORIN" --- scripts/kconfig/lxdialog/menubox.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'scripts/kconfig/lxdialog/menubox.c') diff --git a/scripts/kconfig/lxdialog/menubox.c b/scripts/kconfig/lxdialog/menubox.c index 48d382e7e374..38cd69c5660e 100644 --- a/scripts/kconfig/lxdialog/menubox.c +++ b/scripts/kconfig/lxdialog/menubox.c @@ -303,10 +303,11 @@ do_resize: } } - if (i < max_choice || - key == KEY_UP || key == KEY_DOWN || - key == '-' || key == '+' || - key == KEY_PPAGE || key == KEY_NPAGE) { + if (item_count() != 0 && + (i < max_choice || + key == KEY_UP || key == KEY_DOWN || + key == '-' || key == '+' || + key == KEY_PPAGE || key == KEY_NPAGE)) { /* Remove highligt of current item */ print_item(scroll + choice, choice, FALSE); -- cgit