Browse Source

[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>
tags/v1.20.1
Michael Brown 12 years ago
parent
commit
f5c644cbe1
1 changed files with 2 additions and 2 deletions
  1. 2
    2
      src/hci/tui/menu_ui.c

+ 2
- 2
src/hci/tui/menu_ui.c View File

@@ -315,9 +315,9 @@ int show_menu ( struct menu *menu, unsigned int timeout_ms,
315 315
 	ui.timeout = ( ( timeout_ms * TICKS_PER_SEC ) / 1000 );
316 316
 	list_for_each_entry ( item, &menu->items, list ) {
317 317
 		if ( item->label ) {
318
-			labelled_count++;
319
-			if ( ! ui.selected )
318
+			if ( ! labelled_count )
320 319
 				ui.selected = ui.count;
320
+			labelled_count++;
321 321
 			if ( item->is_default )
322 322
 				ui.selected = ui.count;
323 323
 		}

Loading…
Cancel
Save