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>
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]))