summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/error.c2
-rw-r--r--src/eval.c6
-rw-r--r--src/main.c2
3 files changed, 6 insertions, 4 deletions
diff --git a/src/error.c b/src/error.c
index e304d3d..f1a358d 100644
--- a/src/error.c
+++ b/src/error.c
@@ -163,6 +163,8 @@ sh_error(const char *msg, ...)
 {
 	va_list ap;
 
+	exitstatus = 2;
+
 	va_start(ap, msg);
 	exverror(EXERROR, msg, ap);
 	/* NOTREACHED */
diff --git a/src/eval.c b/src/eval.c
index ea4afc6..013a8dd 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -823,11 +823,13 @@ evalcommand(union node *cmd, int flags)
 	}
 
 	if (status) {
+bail:
+		exitstatus = status;
+
 		/* We have a redirection error. */
 		if (spclbltin > 0)
 			exraise(EXERROR);
-bail:
-		exitstatus = status;
+
 		goto out;
 	}
 
diff --git a/src/main.c b/src/main.c
index 2bff956..1735c67 100644
--- a/src/main.c
+++ b/src/main.c
@@ -113,8 +113,6 @@ main(int argc, char **argv)
 		reset();
 
 		e = exception;
-		if (e == EXERROR)
-			exitstatus = 2;
 
 		s = state;
 		if (e == EXEXIT || s == 0 || iflag == 0 || shlvl)
5-21Do not sort results in scoop by defaultJune McEnroe 2020-05-21Expand and clarify documentationJune McEnroe 2020-05-21Execute PAGER with the SHELLJune McEnroe 2020-05-21Automatically perform database migrations in litterboxJune McEnroe 2020-05-20Don't install rc scripts on other platformsJune McEnroe 2020-05-20Rewrite build and install like pounce 1.3June McEnroe 2020-05-20Update email addressesJune McEnroe 2020-04-23Call updateConsumer from handleError 1.2p1June McEnroe 2020-04-20Use . as ${LDLIBS.$@} separatorJune McEnroe 2020-04-05Error on invalid ISUPPORT values 1.2June McEnroe 2020-04-05Only set RCS on FreeBSDJune McEnroe 2020-04-05Log bans and unbansJune McEnroe 2020-04-05Parse mode types from ISUPPORTJune McEnroe 2020-04-05Add unscoop matchers for ban/unban eventsJune McEnroe 2020-04-05Check unscoop regexps with make testJune McEnroe 2020-04-05Add unscoop -n flag for checking regexpsJune McEnroe 2020-04-05Add Ban and Unban event typesJune McEnroe 2020-04-02Update styleJune McEnroe 2020-03-31Update unscoop catgirl matchersJune McEnroe 2020-03-31Fix writing verbose to stderrJune McEnroe 2020-03-02Include <>/-/* around nicks in scoop coloring 1.1June McEnroe 2020-03-02Replace .mk files with configure scriptJune McEnroe 2020-02-28Implement the causal.agency/consumer capabilityJune McEnroe 2020-02-22Include <>/-/* around nicks in coloringJune McEnroe 2020-02-22Use (almost) the full range of IRC colors for nicksJune McEnroe