|
@@ -247,13 +247,17 @@ static int menu_loop ( struct menu_ui *ui, struct menu_item **selected ) {
|
247
|
247
|
i = 0;
|
248
|
248
|
list_for_each_entry ( item, &ui->menu->items,
|
249
|
249
|
list ) {
|
250
|
|
- if ( item->shortcut &&
|
251
|
|
- ( item->shortcut == key ) ) {
|
252
|
|
- ui->selected = i;
|
|
250
|
+ if ( ! ( item->shortcut &&
|
|
251
|
+ ( item->shortcut == key ) ) ) {
|
|
252
|
+ i++;
|
|
253
|
+ continue;
|
|
254
|
+ }
|
|
255
|
+ ui->selected = i;
|
|
256
|
+ if ( item->label ) {
|
253
|
257
|
chosen = 1;
|
254
|
|
- break;
|
|
258
|
+ } else {
|
|
259
|
+ move = +1;
|
255
|
260
|
}
|
256
|
|
- i++;
|
257
|
261
|
}
|
258
|
262
|
break;
|
259
|
263
|
}
|
|
@@ -284,12 +288,10 @@ static int menu_loop ( struct menu_ui *ui, struct menu_item **selected ) {
|
284
|
288
|
draw_menu_item ( ui, ui->selected );
|
285
|
289
|
}
|
286
|
290
|
|
287
|
|
- /* Refuse to choose unlabelled items (i.e. separators) */
|
288
|
|
- item = menu_item ( ui->menu, ui->selected );
|
289
|
|
- if ( ! item->label )
|
290
|
|
- chosen = 0;
|
291
|
|
-
|
292
|
291
|
/* Record selection */
|
|
292
|
+ item = menu_item ( ui->menu, ui->selected );
|
|
293
|
+ assert ( item != NULL );
|
|
294
|
+ assert ( item->label != NULL );
|
293
|
295
|
*selected = item;
|
294
|
296
|
|
295
|
297
|
} while ( ( rc == 0 ) && ! chosen );
|