nshlib: Reset NSH_NP_SET_OPTIONS_INIT in nsh_initscript

to ensure the reset get executed in all console implementation

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
Xiang Xiao 2020-04-17 13:55:15 +08:00 committed by patacongo
parent ac5632fc50
commit 9dbdc73df6
2 changed files with 6 additions and 6 deletions

View File

@ -96,12 +96,6 @@ int nsh_consolemain(int argc, char *argv[])
/* Execute the start-up script */
nsh_initscript(&pstate->cn_vtbl);
#ifndef CONFIG_NSH_DISABLESCRIPT
/* Reset the option flags */
pstate->cn_vtbl.np.np_flags = NSH_NP_SET_OPTIONS_INIT;
#endif
#endif
#ifdef CONFIG_NSH_NETINIT

View File

@ -191,6 +191,12 @@ int nsh_initscript(FAR struct nsh_vtbl_s *vtbl)
{
ret = nsh_script(vtbl, "init", NSH_INITPATH);
#ifndef CONFIG_NSH_DISABLESCRIPT
/* Reset the option flags */
vtbl->np.np_flags = NSH_NP_SET_OPTIONS_INIT;
#endif
#if defined(CONFIG_NSH_ARCHINIT) && defined(CONFIG_BOARDCTL_FINALINIT)
/* Perform architecture-specific final-initialization (if configured) */