summary refs log tree commit diff
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2021-06-20 13:45:29 -0400
committerJune McEnroe <june@causal.agency>2021-06-20 13:46:46 -0400
commite4554744950ee3262940fc97177d36affbd06b1f (patch)
tree0af86e1709bc057d14127b3c7c35f0b872b44b03
parentsctd more aggressively (diff)
parentSquashed 'bin/dash/' changes from a45870f7..efc7765b (diff)
downloadsrc-e4554744950ee3262940fc97177d36affbd06b1f.tar.gz
src-e4554744950ee3262940fc97177d36affbd06b1f.zip
Merge dash v0.5.11.4
-rw-r--r--bin/dash/configure.ac2
-rw-r--r--bin/dash/src/eval.c12
-rw-r--r--bin/dash/src/jobs.c4
3 files changed, 6 insertions, 12 deletions
diff --git a/bin/dash/configure.ac b/bin/dash/configure.ac
index 1edc45b8..dc96b748 100644
--- a/bin/dash/configure.ac
+++ b/bin/dash/configure.ac
@@ -1,4 +1,4 @@
-AC_INIT([dash],[0.5.11.2])
+AC_INIT([dash],[0.5.11.4])
 AM_INIT_AUTOMAKE([foreign subdir-objects])
 AC_CONFIG_SRCDIR([src/main.c])
 
diff --git a/bin/dash/src/eval.c b/bin/dash/src/eval.c
index 1b5d61dc..d4190f95 100644
--- a/bin/dash/src/eval.c
+++ b/bin/dash/src/eval.c
@@ -245,18 +245,10 @@ evaltree(union node *n, int flags)
 			popredir(0);
 		goto setstatus;
 	case NCMD:
-#ifdef notyet
-		if (eflag && !(flags & EV_TESTED))
-			checkexit = ~0;
-		status = evalcommand(n, flags, (struct backcmd *)NULL);
-		goto setstatus;
-#else
 		evalfn = evalcommand;
 checkexit:
-		if (eflag && !(flags & EV_TESTED))
-			checkexit = ~0;
+		checkexit = ~flags & EV_TESTED;
 		goto calleval;
-#endif
 	case NFOR:
 		evalfn = evalfor;
 		goto calleval;
@@ -316,7 +308,7 @@ setstatus:
 out:
 	dotrap();
 
-	if (checkexit & status)
+	if (eflag && checkexit && status)
 		goto exexit;
 
 	if (flags & EV_EXIT) {
diff --git a/bin/dash/src/jobs.c b/bin/dash/src/jobs.c
index 5104a5e5..8fb9d4b2 100644
--- a/bin/dash/src/jobs.c
+++ b/bin/dash/src/jobs.c
@@ -81,6 +81,7 @@
 #define DOWAIT_NONBLOCK 0
 #define DOWAIT_BLOCK 1
 #define DOWAIT_WAITCMD 2
+#define DOWAIT_WAITCMD_ALL 4
 
 /* array of jobs */
 static struct job *jobtab;
@@ -615,7 +616,7 @@ waitcmd(int argc, char **argv)
 				jp->waited = 1;
 				jp = jp->prev_job;
 			}
-			if (!dowait(DOWAIT_WAITCMD, 0))
+			if (!dowait(DOWAIT_WAITCMD_ALL, 0))
 				goto sigout;
 		}
 	}
@@ -1139,6 +1140,7 @@ static int dowait(int block, struct job *jp)
 		pid = waitone(block, jp);
 		rpid &= !!pid;
 
+		block &= ~DOWAIT_WAITCMD_ALL;
 		if (!pid || (jp && jp->state != JOBRUNNING))
 			block = DOWAIT_NONBLOCK;
 	} while (pid >= 0);