about summary refs log tree commit diff
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2006-03-03 22:27:02 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2006-03-03 22:27:02 +0000
commit4065dd5258d64f2f450a73c80cf2a394d56251da (patch)
treedbc075d018a61e7211cc308befbf6a0c237fee0e
parent862c974d7cbb31c6b4e75163a2b61c85a268542b (diff)
downloadzsh-4065dd5258d64f2f450a73c80cf2a394d56251da.tar.gz
zsh-4065dd5258d64f2f450a73c80cf2a394d56251da.tar.xz
zsh-4065dd5258d64f2f450a73c80cf2a394d56251da.zip
22318: uniquifying special arrays was broken
-rw-r--r--ChangeLog6
-rw-r--r--Src/builtin.c3
2 files changed, 8 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 19e43c838..86f2bfa00 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2006-03-03  Peter Stephenson  <p.w.stephenson@ntlworld.com>
+
+	* 22318: Src/builtin.c: uniquifying special arrays was broken.
+
+	* 22277: Test/C03traps.ztst: missed this.
+
 2006-03-02  Peter Stephenson  <p.w.stephenson@ntlworld.com>
 
 	* 22317: Src/builtins.c, Src/exec.c: exiting the shell from
diff --git a/Src/builtin.c b/Src/builtin.c
index d51149ec6..ce3aec0a2 100644
--- a/Src/builtin.c
+++ b/Src/builtin.c
@@ -1924,8 +1924,9 @@ typeset_single(char *cname, char *pname, Param pm, UNUSED(int func),
 	    Param apm;
 	    char **x;
 	    if (PM_TYPE(pm->flags) == PM_ARRAY) {
-		x = (*pm->gsu.a->getfn)(pm);
+		x = zarrdup((*pm->gsu.a->getfn)(pm));
 		uniqarray(x);
+		pm->gsu.a->setfn(pm, x);
 		if (pm->ename && x)
 		    arrfixenv(pm->ename, x);
 	    } else if (PM_TYPE(pm->flags) == PM_SCALAR && pm->ename &&