summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--Src/subst.c7
2 files changed, 9 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index e12ed92e0..e4965b804 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2023-09-22 Bart Schaefer <schaefer@zsh.org>
+
+ * 52176: Src/subst.c: metafy return from ${ ... } substitution
+ (adapted from Jun T.: 52172)
+
2023-09-20 Oliver Kiddle <opk@zsh.org>
* Jörg Sommer: 51747: Functions/Misc/run-help-ip:
diff --git a/Src/subst.c b/Src/subst.c
index dc2052ee0..f37ae935e 100644
--- a/Src/subst.c
+++ b/Src/subst.c
@@ -2003,11 +2003,12 @@ paramsubst(LinkList l, LinkNode n, char **str, int qt, int pf_flags,
} else /* parse error */
errflag |= ERRFLAG_ERROR;
if (rplytmp && !errflag) {
- int onoerrs = noerrs;
+ int onoerrs = noerrs, rplylen;
noerrs = 2;
- if ((cmdarg = ztuff(rplytmp)))
- setsparam("REPLY", cmdarg);
+ rplylen = zstuff(&cmdarg, rplytmp);
noerrs = onoerrs;
+ if (rplylen >= 0)
+ setsparam("REPLY", metafy(cmdarg, rplylen, META_REALLOC));
}
}