From: Matt Fleming Date: Tue, 9 Oct 2012 12:33:51 +0000 (+0100) Subject: menu: Don't highlight disabled entries X-Git-Tag: syslinux-4.06-pre13~8 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c823574f53c1729790a5d38d02204118389cddf6;p=profile%2Fivi%2Fsyslinux.git 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 Signed-off-by: Matt Fleming --- diff --git a/com32/menu/menumain.c b/com32/menu/menumain.c index 5b3f6bd..7c58979 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]))