aboutsummaryrefslogtreecommitdiff
path: root/bin/sh/expand.c
diff options
context:
space:
mode:
authorJilles Tjoelker <jilles@FreeBSD.org>2017-03-04 22:58:34 +0000
committerJilles Tjoelker <jilles@FreeBSD.org>2017-03-04 22:58:34 +0000
commit586fd248570cdd61c88871a235864ee9fa7aef32 (patch)
treeb89086c8bb0e479d2a3ed9bf98705a1f15275133 /bin/sh/expand.c
parent9c4241c3d7a90548df819a624cbdcf8e5235ca82 (diff)
Notes
Diffstat (limited to 'bin/sh/expand.c')
-rw-r--r--bin/sh/expand.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/bin/sh/expand.c b/bin/sh/expand.c
index be0f53ed051d9..832b51f12f53a 100644
--- a/bin/sh/expand.c
+++ b/bin/sh/expand.c
@@ -460,7 +460,6 @@ expbackq(union node *cmd, int quoted, int flag, struct worddest *dst)
p = grabstackstr(dest);
evalbackcmd(cmd, &in);
ungrabstackstr(p, dest);
- argbackq = saveargbackq;
p = in.buf;
nnl = 0;
@@ -514,12 +513,16 @@ expbackq(union node *cmd, int quoted, int flag, struct worddest *dst)
close(in.fd);
if (in.buf)
ckfree(in.buf);
- if (in.jp)
+ if (in.jp) {
+ p = grabstackstr(dest);
exitstatus = waitforjob(in.jp, (int *)NULL);
+ ungrabstackstr(p, dest);
+ }
TRACE(("expbackq: size=%td: \"%.*s\"\n",
((dest - stackblock()) - startloc),
(int)((dest - stackblock()) - startloc),
stackblock() + startloc));
+ argbackq = saveargbackq;
expdest = dest;
INTON;
}