about summary refs log tree commit diff
path: root/Src/builtin.c
diff options
context:
space:
mode:
authorBart Schaefer <schaefer@ipost.com>2020-12-04 16:14:28 -0800
committerBart Schaefer <schaefer@ipost.com>2021-04-13 21:18:35 -0700
commit69bd4a197c0df766d84dcaadbd76bc7a8e94a6ce (patch)
tree354c33b7489f4f814b34b79760d62cfd670949d9 /Src/builtin.c
parent733c166115841e42c39a5a11fed0a3e79b12d7d1 (diff)
downloadzsh-69bd4a197c0df766d84dcaadbd76bc7a8e94a6ce.tar.gz
zsh-69bd4a197c0df766d84dcaadbd76bc7a8e94a6ce.tar.xz
zsh-69bd4a197c0df766d84dcaadbd76bc7a8e94a6ce.zip
Final repairs for declared state of tied arrays
Fixups still required in bin_typeset, but assignments to scalar work.
Diffstat (limited to 'Src/builtin.c')
-rw-r--r--Src/builtin.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/Src/builtin.c b/Src/builtin.c
index fff0b641f..8d8ff68e0 100644
--- a/Src/builtin.c
+++ b/Src/builtin.c
@@ -2837,7 +2837,7 @@ bin_typeset(char *name, char **argv, LinkList assigns, Options ops, int func)
 	    unqueue_signals();
 	    return 1;
 	} else if (pm) {
-	    if (!(pm->node.flags & PM_UNSET)
+	    if ((!(pm->node.flags & PM_UNSET) || pm->node.flags & PM_DECLARED)
 		&& (locallevel == pm->level || !(on & PM_LOCAL))) {
 		if (pm->node.flags & PM_TIED) {
 		    if (PM_TYPE(pm->node.flags) != PM_SCALAR) {
@@ -2933,7 +2933,7 @@ bin_typeset(char *name, char **argv, LinkList assigns, Options ops, int func)
 	if (asg->value.array) {
 	    int flags = (asg->flags & ASG_KEY_VALUE) ? ASSPM_KEY_VALUE : 0;
 	    assignaparam(asg->name, zlinklist2array(asg->value.array, 1), flags);
-	} else /*if (asg0.value.scalar || oldval)*/ {
+	} else if (asg0.value.scalar || oldval) {
 	    /* We have to undo what we did wrong with asg2 */
 	    apm->node.flags &= ~PM_DECLAREDNULL;
 	    if (oldval)