Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[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>
  • Loading branch information
mcb30 committed Mar 30, 2012
1 parent 4dbb193 commit f5c644c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/hci/tui/menu_ui.c
Expand Up @@ -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;
}
Expand Down

0 comments on commit f5c644c

Please sign in to comment.