about summary refs log tree commit diff
path: root/Src
diff options
context:
space:
mode:
authorBart Schaefer <barts@users.sourceforge.net>2012-02-20 17:50:39 +0000
committerBart Schaefer <barts@users.sourceforge.net>2012-02-20 17:50:39 +0000
commit15138d4fb7a40a1276722924b0482f53c83468f3 (patch)
treec313e526de9f0cd381b9b0158c942376520457fe /Src
parent5f25bb8223d090d13af5869893fa35e5b8c44182 (diff)
downloadzsh-15138d4fb7a40a1276722924b0482f53c83468f3.tar.gz
zsh-15138d4fb7a40a1276722924b0482f53c83468f3.tar.xz
zsh-15138d4fb7a40a1276722924b0482f53c83468f3.zip
30242: use PREFORK_SINGLE for ${...=...} in POSIX emulation
Diffstat (limited to 'Src')
-rw-r--r--Src/subst.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/Src/subst.c b/Src/subst.c
index 894f9cd2f..b9229861b 100644
--- a/Src/subst.c
+++ b/Src/subst.c
@@ -2693,7 +2693,12 @@ paramsubst(LinkList l, LinkNode n, char **str, int qt, int pf_flags)
 		*idend = '\0';
 		val = dupstring(s);
 		if (spsep || !arrasg) {
-		    multsub(&val, PREFORK_NOSHWORDSPLIT, NULL, &isarr, NULL);
+		    /* POSIX requires PREFORK_SINGLE semantics here, but
+		     * traditional zsh used PREFORK_NOSHWORDSPLIT.  Base
+		     * behavior on caller choice of PREFORK_SHWORDSPLIT. */
+		    multsub(&val,
+			    spbreak ? PREFORK_SINGLE : PREFORK_NOSHWORDSPLIT,
+			    NULL, &isarr, NULL);
 		} else {
 		    if (spbreak)
 			split_flags = PREFORK_SPLIT|PREFORK_SHWORDSPLIT;