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-10 14:12:29 -0700
commitb1bd99b67f1a2e09dff651f102249c441529d530 (patch)
tree7f3866411235405300903fdad4557bf9834d6625 /Src/builtin.c
parentfa5f59bf710099dcaa8f22729591c2580c052db9 (diff)
downloadzsh-b1bd99b67f1a2e09dff651f102249c441529d530.tar.gz
zsh-b1bd99b67f1a2e09dff651f102249c441529d530.tar.xz
zsh-b1bd99b67f1a2e09dff651f102249c441529d530.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)