about summary refs log tree commit diff
diff options
context:
space:
mode:
authorPeter Stephenson <pws@zsh.org>2015-06-24 14:32:15 +0100
committerPeter Stephenson <pws@zsh.org>2015-06-24 14:32:15 +0100
commit7b46509e92dbef7bbe26b74d241dd906eaed0aef (patch)
treebbc6fc913d670a8ba4213ca20ea18e9382d695c7
parent39b28980f38e83e15cdeb19a489b5659af97fe93 (diff)
downloadzsh-7b46509e92dbef7bbe26b74d241dd906eaed0aef.tar.gz
zsh-7b46509e92dbef7bbe26b74d241dd906eaed0aef.tar.xz
zsh-7b46509e92dbef7bbe26b74d241dd906eaed0aef.zip
35590: tweak and test text output from typeset
-rw-r--r--ChangeLog3
-rw-r--r--Src/text.c2
-rw-r--r--Test/B02typeset.ztst12
3 files changed, 17 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 0295d5a2b..f3be8cf1b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2015-06-24  Peter Stephenson  <p.stephenson@samsung.com>
 
+	* 35590: Src/text.c, Test/B02typeset.ztst: tweak and
+	test text output for typeset.
+
 	* various culminating in 35586, c.f. commits on typeset-array
 	branch: Config/version.mk, Doc/Zsh/builtins.yo,
 	Doc/Zsh/grammar.yo, Doc/Zsh/options.yo, NEWS, README,
diff --git a/Src/text.c b/Src/text.c
index a72ab33e6..3287c54ac 100644
--- a/Src/text.c
+++ b/Src/text.c
@@ -189,6 +189,8 @@ taddassign(wordcode code, Estate state, int typeset)
 static void
 taddassignlist(Estate state, wordcode count)
 {
+    if (count)
+	taddchr(' ');
     while (count--) {
 	wordcode code = *state->pc++;
 	taddassign(code, state, 1);
diff --git a/Test/B02typeset.ztst b/Test/B02typeset.ztst
index 4afb18962..e6285bc05 100644
--- a/Test/B02typeset.ztst
+++ b/Test/B02typeset.ztst
@@ -651,3 +651,15 @@
 >odd
 >number
 >here
+
+  fn() { typeset foo bar thing=this stuff=(that other) more=woevva; }
+  which -x2 fn
+  fn2() { typeset assignfirst=(why not); }
+  which -x2 fn2
+0:text output from typeset
+>fn () {
+>  typeset foo bar thing=this stuff=(that other) more=woevva 
+>}
+>fn2 () {
+>  typeset assignfirst=(why not) 
+>}