Tomas reported that the 'test1' submenu in the following config file
snippet doesn't honour the MENU DEFAULT directive,
MENU BEGIN test0
MENU START
LABEL -
MENU DEFAULT
MENU LABEL OptionA
MENU GOTO test1
MENU END
MENU BEGIN test1
LABEL -
MENU LABEL OptionA1
MENU GOTO test0
LABEL -
MENU DEFAULT
MENU LABEL OptionB1
MENU GOTO test0
MENU END
The reason is that the menu config code doesn't know how to handle a
default item that is a MENU GOTO directive. A trivial addition to the
code in record() fixes this.
Reported-by: Tomas M <tomas@slax.org>
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
break;
}
- if (ld->menudefault && me->action == MA_CMD)
+ if (ld->menudefault && (me->action == MA_CMD ||
+ me->action == MA_GOTO ||
+ me->action == MA_GOTO_UNRES))
m->defentry = m->nentries - 1;
}