summaryrefslogtreecommitdiffstats
path: root/src/hci/tui
diff options
context:
space:
mode:
authorMichael Brown2012-03-30 18:57:52 +0200
committerMichael Brown2012-03-30 18:57:52 +0200
commitf5c644cbe156573d23824a5c7046d1dec93eaf58 (patch)
tree73db6acb4667caad1c8628cb35e20d32b203ee76 /src/hci/tui
parent[int13] Add support for emulating floppy disk drives (diff)
downloadipxe-f5c644cbe156573d23824a5c7046d1dec93eaf58.tar.gz
ipxe-f5c644cbe156573d23824a5c7046d1dec93eaf58.tar.xz
ipxe-f5c644cbe156573d23824a5c7046d1dec93eaf58.zip
[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>
Diffstat (limited to 'src/hci/tui')
-rw-r--r--src/hci/tui/menu_ui.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/hci/tui/menu_ui.c b/src/hci/tui/menu_ui.c
index 6b1b6323..2457a825 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;
}