about summary refs log tree commit diff
path: root/Src
diff options
context:
space:
mode:
authorTanaka Akira <akr@users.sourceforge.net>1999-08-28 05:03:53 +0000
committerTanaka Akira <akr@users.sourceforge.net>1999-08-28 05:03:53 +0000
commit57b1435008c6163cdc59a4155ce0a8f17ab3c85c (patch)
treebc6bb15257cb9aa0a5c05a5edf674486c4d1f936 /Src
parent878966e6b94b1b5222be9100af8d84fa3479e4a7 (diff)
downloadzsh-57b1435008c6163cdc59a4155ce0a8f17ab3c85c.tar.gz
zsh-57b1435008c6163cdc59a4155ce0a8f17ab3c85c.tar.xz
zsh-57b1435008c6163cdc59a4155ce0a8f17ab3c85c.zip
zsh-users/2529
Diffstat (limited to 'Src')
-rw-r--r--Src/params.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/Src/params.c b/Src/params.c
index 4c462ff0a..48d6bcf8a 100644
--- a/Src/params.c
+++ b/Src/params.c
@@ -1697,9 +1697,14 @@ sethparam(char *s, char **val)
 	    v = NULL;
 	}
     }
-    if (!v)
-	if (!(v = getvalue(&t, 1)))
-	    return NULL;
+    if (!v) {
+	int k = opts[KSHARRAYS];	/* Remember the value of KSHARRAYS */
+	opts[KSHARRAYS] = 0;		/* and clear it to avoid special-  */
+	v = getvalue(&t, 1);		/* case of $array --> ${array[0]}. */
+	opts[KSHARRAYS] = k;		/* OK because we can't assign to a */
+	if (!v)				/* slice of an association anyway, */
+	    return NULL;		/* so ANY subscript will be wrong. */
+    }
     setarrvalue(v, val);
     return v->pm;
 }