nsh: fix nsh startup failure

Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
This commit is contained in:
yinshengkai 2023-03-01 17:04:49 +08:00 committed by Xiang Xiao
parent 5e4c4d7393
commit fa589ae622

View File

@ -165,10 +165,17 @@ int nsh_script(FAR struct nsh_vtbl_s *vtbl, FAR const FAR char *cmd,
nsh_output(vtbl, "%s", buffer);
}
ret = nsh_parse(vtbl, buffer);
if (vtbl->np.np_flags & NSH_PFLAG_IGNORE)
{
nsh_parse(vtbl, buffer);
}
else
{
ret = nsh_parse(vtbl, buffer);
}
}
}
while (ret >= 0 || (vtbl->np.np_flags & NSH_PFLAG_IGNORE));
while (ret >= 0);
/* Close the script file */