aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2008-02-19 18:27:35 -0800
committerH. Peter Anvin <hpa@zytor.com>2008-02-19 18:27:35 -0800
commit905ba26066f92b6ad64941dbfbb0463112b35275 (patch)
tree7d24d7c4305a666eba76aa8848f171586b4926ca
parent3710870073b0183bb312c676392738207cd75616 (diff)
downloadsyslinux-905ba26066f92b6ad64941dbfbb0463112b35275.tar.gz
syslinux-905ba26066f92b6ad64941dbfbb0463112b35275.tar.xz
syslinux-905ba26066f92b6ad64941dbfbb0463112b35275.zip
simple menu: fix the handling of '+' and '-' given disabled entries
When encountering disabled entries, we want to keep going. Given that these particular keys have nonstandard scrolling, but the handling there.
-rw-r--r--com32/menu/menumain.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/com32/menu/menumain.c b/com32/menu/menumain.c
index 2bbbc4f8..73049867 100644
--- a/com32/menu/menumain.c
+++ b/com32/menu/menumain.c
@@ -914,13 +914,17 @@ run_menu(void)
break;
case '-':
- entry--;
- top--;
+ do {
+ entry--;
+ top--;
+ } while (entry > 0 && is_disabled(cm->menu_entries[entry]));
break;
case '+':
- entry++;
- top++;
+ do {
+ entry++;
+ top++;
+ } while (entry < cm->nentries-1 && is_disabled(cm->menu_entries[entry]));
break;
case KEY_CTRL('A'):