summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2008-07-02 18:34:49 -0700
committerH. Peter Anvin <hpa@zytor.com>2008-07-02 18:34:49 -0700
commit2b7251b3905e58ef5c34bb4b009ae537eb1b9333 (patch)
treea47b08d7fe87db64d9dd2c6fc3953ff98c88db27
parent062099696d46e42bb970165e945065a05c138ffd (diff)
downloadsyslinux-2b7251b3905e58ef5c34bb4b009ae537eb1b9333.tar.gz
Simple menu: really avoid disabled entriessyslinux-3.71-pre2
Really, really try to avoid stepping on disabled entries...
-rw-r--r--NEWS6
-rw-r--r--com32/menu/menumain.c52
2 files changed, 36 insertions, 22 deletions
diff --git a/NEWS b/NEWS
index 6df01f64..81ab3fa0 100644
--- a/NEWS
+++ b/NEWS
@@ -2,6 +2,12 @@ Starting with 1.47, changes marked with SYSLINUX/PXELINUX/ISOLINUX
apply to that specific program only; other changes apply to all of
them.
+Changes in 3.71:
+ * Workaround for a VESA BIOS which tries to make DOS system
+ calls(!!)
+ * Simple menu: fix navigation around disabled entries
+ (or at least try to...)
+
Changes in 3.70:
* PXELINUX: Support enhanced capabilities when running on top
of gPXE (http://www.etherboot.org/). In particular, support
diff --git a/com32/menu/menumain.c b/com32/menu/menumain.c
index f79d00e4..01b4fb4b 100644
--- a/com32/menu/menumain.c
+++ b/com32/menu/menumain.c
@@ -747,13 +747,12 @@ run_menu(void)
}
while ( !done ) {
- if ( entry <= 0 ) {
+ if (entry <= 0) {
entry = 0;
while (entry < cm->nentries && is_disabled(cm->menu_entries[entry]))
entry++;
}
-
- if ( entry >= cm->nentries ) {
+ if (entry >= cm->nentries) {
entry = cm->nentries-1;
while (entry > 0 && is_disabled(cm->menu_entries[entry]))
entry--;
@@ -871,28 +870,23 @@ run_menu(void)
case KEY_UP:
case KEY_CTRL('P'):
- while (entry > 0 && entry-- && is_disabled(cm->menu_entries[entry])) {
- if ( entry < top )
+ while (entry > 0) {
+ entry--;
+ if (entry < top)
top -= MENU_ROWS;
- }
-
- if ( entry == 0 ) {
- while (is_disabled(cm->menu_entries[entry]))
- entry++;
+ if (!is_disabled(cm->menu_entries[entry]))
+ break;
}
break;
case KEY_DOWN:
case KEY_CTRL('N'):
- while (entry < cm->nentries-1 && entry++ &&
- is_disabled(cm->menu_entries[entry])) {
- if ( entry >= top+MENU_ROWS )
+ while (entry < cm->nentries-1) {
+ entry++;
+ if (entry >= top+MENU_ROWS)
top += MENU_ROWS;
- }
-
- if ( entry >= cm->nentries-1 ) {
- while (is_disabled(cm->menu_entries[entry]))
- entry--;
+ if (!is_disabled(cm->menu_entries[entry]))
+ break;
}
break;
@@ -902,6 +896,11 @@ run_menu(void)
case '<':
entry -= MENU_ROWS;
top -= MENU_ROWS;
+ while (entry > 0 && is_disabled(cm->menu_entries[entry])) {
+ entry--;
+ if (entry < top)
+ top -= MENU_ROWS;
+ }
break;
case KEY_PGDN:
@@ -911,20 +910,29 @@ run_menu(void)
case ' ':
entry += MENU_ROWS;
top += MENU_ROWS;
+ while (entry < cm->nentries-1 && is_disabled(cm->menu_entries[entry])) {
+ entry++;
+ if (entry >= top+MENU_ROWS)
+ top += MENU_ROWS;
+ }
break;
case '-':
- do {
+ while (entry > 0) {
entry--;
top--;
- } while (entry > 0 && is_disabled(cm->menu_entries[entry]));
+ if (!is_disabled(cm->menu_entries[entry]))
+ break;
+ }
break;
case '+':
- do {
+ while (entry < cm->nentries-1) {
entry++;
top++;
- } while (entry < cm->nentries-1 && is_disabled(cm->menu_entries[entry]));
+ if (!is_disabled(cm->menu_entries[entry]))
+ break;
+ }
break;
case KEY_CTRL('A'):