From e26b8368a94163148fc3c94a346151e22cede10c Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Tue, 5 May 2020 00:06:42 -0500 Subject: Remove leftover increment and move variable clear after error report. --- toys/pending/sh.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'toys/pending') diff --git a/toys/pending/sh.c b/toys/pending/sh.c index 79509084..4abe6579 100644 --- a/toys/pending/sh.c +++ b/toys/pending/sh.c @@ -1666,7 +1666,7 @@ static int parse_line(char *line, struct sh_function *sp) arg += 1+pl->here; // Match unquoted EOF. - for (s = line, end = arg->v[arg->c]; *s && *end; s++, i++) { + for (s = line, end = arg->v[arg->c]; *s && *end; s++) { s += strspn(s, "\\\"'"); if (*s != *end) break; } @@ -2780,10 +2780,10 @@ void exec_main(void) if (TT.exec.a || FLAG(l)) *toys.optargs = xmprintf("%s%s", FLAG(l) ? "-" : "", TT.exec.a?:TT.isexec); sh_exec(toys.optargs); - TT.isexec = 0; // report error (usually ENOENT) and return perror_msg("%s", TT.isexec); + TT.isexec = 0; toys.exitval = 127; environ = old; } -- cgit v1.2.3