simple menu: fix the handling of '+' and '-' given disabled entries
authorH. Peter Anvin <hpa@zytor.com>
Wed, 20 Feb 2008 02:27:35 +0000 (18:27 -0800)
committerH. Peter Anvin <hpa@zytor.com>
Wed, 20 Feb 2008 02:27:35 +0000 (18:27 -0800)
When encountering disabled entries, we want to keep going.  Given that
these particular keys have nonstandard scrolling, but the handling there.

com32/menu/menumain.c

index 2bbbc4f..7304986 100644 (file)
@@ -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'):