about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog11
-rw-r--r--Src/subst.c7
2 files changed, 14 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index 40036c470..d8a426b01 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2012-02-20  Barton E. Schaefer  <schaefer@zsh.org>
+
+	* 30242: Src/subst.c: use PREFORK_SINGLE for the right-hand side
+	of ${...=...} when SH_WORD_SPLIT is in effect (POSIX emulation).
+
 2012-02-19  Peter Stephenson  <p.w.stephenson@ntlworld.com>
 
 	* unposted: Etc/Config.yo, Completion/X/Type/.distfiles,
@@ -67,8 +72,8 @@
 
 2012-02-09  Barton E. Schaefer  <schaefer@zsh.org>
 
-	* 30193: ChangeLog Src/Zle/compcore.c: remnulargs() after poking
-	into string in case length changes.
+	* 30193: Src/Zle/compcore.c: remnulargs() after poking into string
+	in case length changes.
 
 2012-02-08  Peter Stephenson  <pws@csr.com>
 
@@ -15995,5 +16000,5 @@
 
 *****************************************************
 * This is used by the shell to define $ZSH_PATCHLEVEL
-* $Revision: 1.5590 $
+* $Revision: 1.5591 $
 *****************************************************
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;