about summary refs log tree commit diff
path: root/Src/params.c
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2008-10-09 13:46:45 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2008-10-09 13:46:45 +0000
commitad3e2aa2157bc779b596d95987a80b28cf6928b9 (patch)
treead186c4074d05c1b96832aac9c3c72c1def35e0d /Src/params.c
parent86ef4650dccad8dfa00f28c94296dae1ec13d84e (diff)
downloadzsh-ad3e2aa2157bc779b596d95987a80b28cf6928b9.tar.gz
zsh-ad3e2aa2157bc779b596d95987a80b28cf6928b9.tar.xz
zsh-ad3e2aa2157bc779b596d95987a80b28cf6928b9.zip
25831: fix empty return values from subscript matches with RC_EXPAND_PARAM
Diffstat (limited to 'Src/params.c')
-rw-r--r--Src/params.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/Src/params.c b/Src/params.c
index 65b3ecff8..71cb2a907 100644
--- a/Src/params.c
+++ b/Src/params.c
@@ -1810,11 +1810,10 @@ fetchvalue(Value v, char **pptr, int bracks, int flags)
 	    /* Overload v->isarr as the flag bits for hashed arrays. */
 	    v->isarr = flags | (isvarat ? SCANPM_ISVAR_AT : 0);
 	    /* If no flags were passed, we need something to represent *
-	     * `true' yet differ from an explicit WANTVALS.  This is a *
-	     * bit of a hack, but makes some sense:  When no subscript *
-	     * is provided, all values are substituted.                */
+	     * `true' yet differ from an explicit WANTVALS.  Use a     *
+	     * special flag for this case.                             */
 	    if (!v->isarr)
-		v->isarr = SCANPM_MATCHMANY;
+		v->isarr = SCANPM_ARRONLY;
 	}
 	v->pm = pm;
 	v->flags = 0;
@@ -2188,7 +2187,8 @@ setstrvalue(Value v, char *val)
 	zsfree(val);
 	return;
     }
-    if ((v->pm->node.flags & PM_HASHED) && (v->isarr & SCANPM_MATCHMANY)) {
+    if ((v->pm->node.flags & PM_HASHED) &&
+	(v->isarr & (SCANPM_MATCHMANY|SCANPM_ARRONLY))) {
 	zerr("%s: attempt to set slice of associative array", v->pm->node.nam);
 	zsfree(val);
 	return;