about summary refs log tree commit diff
path: root/Src/subst.c
diff options
context:
space:
mode:
authorBart Schaefer <schaefer@zsh.org>2023-09-22 20:29:40 -0500
committerBart Schaefer <schaefer@zsh.org>2023-09-22 20:29:40 -0500
commitb35799269750de2801f8bf292f4374c2fa0f7a09 (patch)
treeb191b92cd90c31dd760b3e0c83c18202a1771c7d /Src/subst.c
parent9eb2b047035273891c66f6d0fc23edb22d6bfad5 (diff)
downloadzsh-b35799269750de2801f8bf292f4374c2fa0f7a09.tar.gz
zsh-b35799269750de2801f8bf292f4374c2fa0f7a09.tar.xz
zsh-b35799269750de2801f8bf292f4374c2fa0f7a09.zip
52176: metafy return from ${ ... } substitution
Diffstat (limited to 'Src/subst.c')
-rw-r--r--Src/subst.c7
1 files changed, 4 insertions, 3 deletions
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));
 	    }
 	}