提交 35912935 编写于 作者: P Petri Lehtinen 提交者: Wolfgang Denk

autoscr: Fix one-character lines and non-newline terminated scripts

When not using hush, the autoscr command now executes lines that are
only one character long. It also runs the last line of scripts even if
it does not end in a newline.
Signed-off-by: NPetri Lehtinen <petri.lehtinen@inoi.fi>
上级 9ebbb54f
......@@ -180,7 +180,7 @@ autoscript (ulong addr, const char *fit_uname)
if (*next == '\n') {
*next = '\0';
/* run only non-empty commands */
if ((next - line) > 1) {
if (*line) {
debug ("** exec: \"%s\"\n",
line);
if (run_command (line, 0) < 0) {
......@@ -192,6 +192,8 @@ autoscript (ulong addr, const char *fit_uname)
}
++next;
}
if (rcode == 0 && *line)
rcode = (run_command(line, 0) >= 0);
}
#endif
free (cmd);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册