From da534b740e628512e8e0e62729d6a2ef521e5096 Mon Sep 17 00:00:00 2001 From: Herbert Xu Date: Tue, 7 Jun 2016 16:47:59 +0800 Subject: eval: Return status in eval functions The exit status is currently clobbered too early for case statements and loops. This patch fixes it by making the eval functions return the current exit status and setting them in one place -- evaltree. Harald van Dijk pointed out a number of bugs in the original patch. Signed-off-by: Herbert Xu --- src/eval.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/eval.h') diff --git a/src/eval.h b/src/eval.h index 6e8acda..63e7d86 100644 --- a/src/eval.h +++ b/src/eval.h @@ -53,7 +53,7 @@ struct backcmd { /* result of evalbackcmd */ int evalstring(char *, int); union node; /* BLETCH for ansi C */ -void evaltree(union node *, int); +int evaltree(union node *, int); void evalbackcmd(union node *, struct backcmd *); extern int evalskip; -- cgit 1.4.1