summary refs log tree commit diff
path: root/Src
diff options
context:
space:
mode:
authorOliver Kiddle <opk@users.sourceforge.net>2004-04-06 13:00:50 +0000
committerOliver Kiddle <opk@users.sourceforge.net>2004-04-06 13:00:50 +0000
commit98e28ff3ed5268c3bff8a81b18dc02331ff741c5 (patch)
tree1e0be242257e32d827ea9dc78c6232a6dad72b2e /Src
parent7af7f23508905e07fcfd990486b2998e0a23014c (diff)
downloadzsh-98e28ff3ed5268c3bff8a81b18dc02331ff741c5.tar.gz
zsh-98e28ff3ed5268c3bff8a81b18dc02331ff741c5.tar.xz
zsh-98e28ff3ed5268c3bff8a81b18dc02331ff741c5.zip
19712, 19740: allow assigning to associations with i and r subscript flags
Diffstat (limited to 'Src')
-rw-r--r--Src/params.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/Src/params.c b/Src/params.c
index 134355173..26ff2c566 100644
--- a/Src/params.c
+++ b/Src/params.c
@@ -381,6 +381,7 @@ scancountparams(HashNode hn, int flags)
 static Patprog scanprog;
 static char *scanstr;
 static char **paramvals;
+static Param foundparam;     
 
 /**/
 void
@@ -404,6 +405,7 @@ scanparamvals(HashNode hn, int flags)
     } else if ((flags & SCANPM_MATCHKEY) && !pattry(scanprog, v.pm->nam)) {
 	return;
     }
+    foundparam = v.pm;
     if (flags & SCANPM_WANTKEYS) {
 	paramvals[numparamvals++] = v.pm->nam;
 	if (!(flags & (SCANPM_WANTVALS|SCANPM_MATCHVAL)))
@@ -1598,7 +1600,7 @@ setstrvalue(Value v, char *val)
 	zsfree(val);
 	return;
     }
-    if (v->pm->flags & PM_HASHED) {
+    if ((v->pm->flags & PM_HASHED) && (v->isarr & SCANPM_MATCHMANY)) {
 	zerr("%s: attempt to set slice of associative array", v->pm->nam, 0);
 	zsfree(val);
 	return;
@@ -1663,6 +1665,11 @@ setstrvalue(Value v, char *val)
 	    setarrvalue(v, ss);
 	}
 	break;
+    case PM_HASHED:
+        {
+	    (foundparam->sets.cfn) (foundparam, val);
+        }
+	break;
     }
     if ((!v->pm->env && !(v->pm->flags & PM_EXPORTED) &&
 	 !(isset(ALLEXPORT) && !(v->pm->flags & PM_HASHELEM))) ||