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: Petri Lehtinen <petri.lehtinen@inoi.fi>
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) {
}
++next;
}
+ if (rcode == 0 && *line)
+ rcode = (run_command(line, 0) >= 0);
}
#endif
free (cmd);