Skip to content

Commit f5c644c

Browse files
committed
[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>
1 parent 4dbb193 commit f5c644c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/hci/tui/menu_ui.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -315,9 +315,9 @@ int show_menu ( struct menu *menu, unsigned int timeout_ms,
315315
ui.timeout = ( ( timeout_ms * TICKS_PER_SEC ) / 1000 );
316316
list_for_each_entry ( item, &menu->items, list ) {
317317
if ( item->label ) {
318-
labelled_count++;
319-
if ( ! ui.selected )
318+
if ( ! labelled_count )
320319
ui.selected = ui.count;
320+
labelled_count++;
321321
if ( item->is_default )
322322
ui.selected = ui.count;
323323
}

0 commit comments

Comments
 (0)