summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog3
-rw-r--r--Src/subst.c3
2 files changed, 5 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index df1097493..2f187a74b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2017-02-19  Barton E. Schaefer  <schaefer@zsh.org>
 
+	* 40593: Src/subst.c: SHWORDSPLIT + unset IFS should cause default
+	splitting of $@ and other array references with (@) or [@]
+
 	* 40576 (tweaked): Src/exec.c: entersubsh(): small improvement to
 	loop that resets trap handlers; unblock any signals that were
 	blocked for trap handling
diff --git a/Src/subst.c b/Src/subst.c
index 670f3f0c6..1c2397c05 100644
--- a/Src/subst.c
+++ b/Src/subst.c
@@ -3476,7 +3476,8 @@ paramsubst(LinkList l, LinkNode n, char **str, int qt, int pf_flags,
 		val = sepjoin(aval, sep, 1);
 		isarr = 0;
 		ms_flags = 0;
-	    } else if (force_split && (spsep || nojoin == 2)) {
+	    } else if (force_split &&
+		       (spsep || nojoin == 2 || (!ifs && isarr < 0))) {
 		/* Hack to simulate splitting individual elements:
 		 * forced joining as previously determined, or
 		 * join on what we later use to forcibly split