summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatt Fleming <matt.fleming@intel.com>2012-10-09 13:33:51 +0100
committerMatt Fleming <matt.fleming@intel.com>2012-10-09 14:04:17 +0100
commitc823574f53c1729790a5d38d02204118389cddf6 (patch)
tree87fa02f521b790f5cb399de0d4c977d3367ad8f5
parent43432388cb7f3d6280066c142fd242195a652f8d (diff)
downloadsyslinux-c823574f53c1729790a5d38d02204118389cddf6.tar.gz
menu: Don't highlight disabled entries
There's an off-by-one bug in the menu input handling code which makes it possible to highlight/select the last entry in a menu even if that entry is disabled. It should be noted that you can't actually *do* anything with the disabled entry, i.e. edit or execute it. Still, allowing it to be highlighted does look a little strange. Reported-by: Matt Sephton <matt.sephton@gmail.com> Signed-off-by: Matt Fleming <matt.fleming@intel.com>
-rw-r--r--com32/menu/menumain.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/com32/menu/menumain.c b/com32/menu/menumain.c
index 5b3f6bd1..7c589797 100644
--- a/com32/menu/menumain.c
+++ b/com32/menu/menumain.c
@@ -958,8 +958,7 @@ static const char *run_menu(void)
case KEY_DOWN:
case KEY_CTRL('N'):
- while (entry < cm->nentries - 1) {
- entry++;
+ while (++entry < cm->nentries) {
if (entry >= top + MENU_ROWS)
top += MENU_ROWS;
if (!is_disabled(cm->menu_entries[entry]))