about summary refs log tree commit diff
path: root/Src/builtin.c
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2012-08-16 14:00:11 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2012-08-16 14:00:11 +0000
commit268e56a1446af3ca6df84789180b87ac4f57d1d3 (patch)
tree57ea3541a19ae7007b910d391bc4a1af6d9d53af /Src/builtin.c
parent1849668c81919808b206550fd176b203e67026db (diff)
downloadzsh-268e56a1446af3ca6df84789180b87ac4f57d1d3.tar.gz
zsh-268e56a1446af3ca6df84789180b87ac4f57d1d3.tar.xz
zsh-268e56a1446af3ca6df84789180b87ac4f57d1d3.zip
30169: repeat "typeset -T" with same two first arguments is not an error
Diffstat (limited to 'Src/builtin.c')
-rw-r--r--Src/builtin.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/Src/builtin.c b/Src/builtin.c
index b5a98cbd2..ce7d6a563 100644
--- a/Src/builtin.c
+++ b/Src/builtin.c
@@ -2449,7 +2449,20 @@ bin_typeset(char *name, char **argv, Options ops, int func)
 	    && (locallevel == pm->level || !(on & PM_LOCAL))) {
 	    if (pm->node.flags & PM_TIED) {
 		unqueue_signals();
-		zerrnam(name, "can't tie already tied scalar: %s", asg0.name);
+		if (!strcmp(asg->name, pm->ename)) {
+		    /*
+		     * Already tied in the fashion requested.
+		     */
+		    struct tieddata *tdp = (struct tieddata*)pm->u.data;
+		    /* Update join character */
+		    tdp->joinchar = joinchar;
+		    if (asg0.value)
+			setsparam(asg0.name, ztrdup(asg0.value));
+		    return 0;
+		} else {
+		    zerrnam(name, "can't tie already tied scalar: %s",
+			    asg0.name);
+		}
 		return 1;
 	    }
 	    if (!asg0.value && !(PM_TYPE(pm->node.flags) & (PM_ARRAY|PM_HASHED)))