summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--bin/sh/eval.c3
-rw-r--r--tools/regression/bin/sh/expansion/cmdsubst11.05
2 files changed, 7 insertions, 1 deletions
diff --git a/bin/sh/eval.c b/bin/sh/eval.c
index 9d67b9e..25793c1 100644
--- a/bin/sh/eval.c
+++ b/bin/sh/eval.c
@@ -140,7 +140,7 @@ evalcmd(int argc, char **argv)
STPUTC('\0', concat);
p = grabstackstr(concat);
}
- evalstring(p, builtin_flags & EV_TESTED);
+ evalstring(p, builtin_flags);
} else
exitstatus = 0;
return exitstatus;
@@ -908,6 +908,7 @@ evalcommand(union node *cmd, int flags, struct backcmd *backcmd)
dup2(pip[1], 1);
close(pip[1]);
}
+ flags &= ~EV_BACKCMD;
}
flags |= EV_EXIT;
}
diff --git a/tools/regression/bin/sh/expansion/cmdsubst11.0 b/tools/regression/bin/sh/expansion/cmdsubst11.0
new file mode 100644
index 0000000..f1af547
--- /dev/null
+++ b/tools/regression/bin/sh/expansion/cmdsubst11.0
@@ -0,0 +1,5 @@
+# $FreeBSD$
+
+# Not required by POSIX but useful for efficiency.
+
+[ $$ = $(eval '${SH} -c echo\ \$PPID') ]
OpenPOWER on IntegriCloud