summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--Src/builtin.c2
-rw-r--r--Test/B02typeset.ztst3
3 files changed, 10 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 5390fef13..103e7a5d5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2015-08-10  Peter Stephenson  <p.w.stephenson@ntlworld.com>
+
+	* 36083: Src/builtin.c, Test/B02typeset.ztst: set array value
+	when consistently retying scalar and array.
+
 2015-08-10  Peter Stephenson  <p.stephenson@samsung.com>
 
 	* 36074: Src/signals.c: Don't rely on implicit value for
diff --git a/Src/builtin.c b/Src/builtin.c
index c63be7e81..4a97a3163 100644
--- a/Src/builtin.c
+++ b/Src/builtin.c
@@ -2685,6 +2685,8 @@ bin_typeset(char *name, char **argv, LinkList assigns, Options ops, int func)
 		    tdp->joinchar = joinchar;
 		    if (asg0.value.scalar)
 			setsparam(asg0.name, ztrdup(asg0.value.scalar));
+		    else if (asg->value.array)
+			setaparam(asg->name, zlinklist2array(asg->value.array));
 		    return 0;
 		} else {
 		    zwarnnam(name, "can't tie already tied scalar: %s",
diff --git a/Test/B02typeset.ztst b/Test/B02typeset.ztst
index a059442e9..2b8e5445c 100644
--- a/Test/B02typeset.ztst
+++ b/Test/B02typeset.ztst
@@ -467,9 +467,12 @@
  print $tied_array
  typeset -T TIED_SCALAR=goo:car tied_array
  print $tied_array
+ typeset -T TIED_SCALAR tied_array=(poo par)
+ print $TIED_SCALAR
 0:retying arrays to same array works
 >foo bar
 >goo car
+>poo:par
 
  (
    setopt POSIXBUILTINS