diff options
author | Michael Brown <mcb30@ipxe.org> | 2012-03-30 17:57:52 +0100 |
---|---|---|
committer | Michael Brown <mcb30@ipxe.org> | 2012-03-30 17:57:52 +0100 |
commit | f5c644cbe156573d23824a5c7046d1dec93eaf58 (patch) | |
tree | 73db6acb4667caad1c8628cb35e20d32b203ee76 | |
parent | 4dbb193c33deda44a966d81b018c73071b4bc9f6 (diff) | |
download | ipxe-f5c644cbe156573d23824a5c7046d1dec93eaf58.tar.gz |
[menu] Fix default selection when default is item 0
Reported-by: Robin Smidsrød <robin@smidsrod.no>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
-rw-r--r-- | src/hci/tui/menu_ui.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/hci/tui/menu_ui.c b/src/hci/tui/menu_ui.c index 6b1b63235..2457a8254 100644 --- a/src/hci/tui/menu_ui.c +++ b/src/hci/tui/menu_ui.c @@ -315,9 +315,9 @@ int show_menu ( struct menu *menu, unsigned int timeout_ms, ui.timeout = ( ( timeout_ms * TICKS_PER_SEC ) / 1000 ); list_for_each_entry ( item, &menu->items, list ) { if ( item->label ) { - labelled_count++; - if ( ! ui.selected ) + if ( ! labelled_count ) ui.selected = ui.count; + labelled_count++; if ( item->is_default ) ui.selected = ui.count; } |