Skip to content

Commit fa589ae

Browse files
Gary-Hobsonxiaoxiang781216
authored andcommitted
nsh: fix nsh startup failure
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
1 parent 5e4c4d7 commit fa589ae

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

nshlib/nsh_script.c

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,10 +165,17 @@ int nsh_script(FAR struct nsh_vtbl_s *vtbl, FAR const FAR char *cmd,
165165
nsh_output(vtbl, "%s", buffer);
166166
}
167167

168-
ret = nsh_parse(vtbl, buffer);
168+
if (vtbl->np.np_flags & NSH_PFLAG_IGNORE)
169+
{
170+
nsh_parse(vtbl, buffer);
171+
}
172+
else
173+
{
174+
ret = nsh_parse(vtbl, buffer);
175+
}
169176
}
170177
}
171-
while (ret >= 0 || (vtbl->np.np_flags & NSH_PFLAG_IGNORE));
178+
while (ret >= 0);
172179

173180
/* Close the script file */
174181

0 commit comments

Comments
 (0)