about summary refs log tree commit diff
path: root/Src/builtin.c
diff options
context:
space:
mode:
Diffstat (limited to 'Src/builtin.c')
-rw-r--r--Src/builtin.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/Src/builtin.c b/Src/builtin.c
index dd553cf1c..cb7c82052 100644
--- a/Src/builtin.c
+++ b/Src/builtin.c
@@ -2006,6 +2006,11 @@ bin_typeset(char *name, char **argv, char *ops, int func)
 	    zerrnam(name, "can't tie a variable to itself", NULL, 0);
 	    return 1;
 	}
+	if (strchr(asg0.name, '[') || strchr(asg->name, '[')) {
+	    unqueue_signals();
+	    zerrnam(name, "can't tie array elements", NULL, 0);
+	    return 1;
+	}
 	/*
 	 * Keep the old value of the scalar.  We need to do this
 	 * here as if it is already tied to the same array it