diff options
author | Daniel Shahaf <d.s@daniel.shahaf.name> | 2015-11-30 03:21:28 +0000 |
---|---|---|
committer | Daniel Shahaf <d.s@daniel.shahaf.name> | 2015-11-30 03:42:46 +0000 |
commit | 4202c90b6d6f1f08cdaf56180f589a00395c32be (patch) | |
tree | f9a06f7d951ef0fcc5fb2b4759d13d68a771391c /Src | |
parent | 503fa5cd9eaf9f8ecc7fcd485ac07b313cec5a53 (diff) | |
download | zsh-4202c90b6d6f1f08cdaf56180f589a00395c32be.tar.gz zsh-4202c90b6d6f1f08cdaf56180f589a00395c32be.tar.xz zsh-4202c90b6d6f1f08cdaf56180f589a00395c32be.zip |
37254: No functional change: change code layout in preparation for 37253.
Diffstat (limited to 'Src')
-rw-r--r-- | Src/params.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/Src/params.c b/Src/params.c index ee1527153..d8bf83d0e 100644 --- a/Src/params.c +++ b/Src/params.c @@ -2537,6 +2537,7 @@ setarrvalue(Value v, char **val) freearray(val); return; } + if (v->start == 0 && v->end == -1) { if (PM_TYPE(v->pm->node.flags) == PM_HASHED) arrhashsetfn(v->pm, val, 0); @@ -2545,18 +2546,17 @@ setarrvalue(Value v, char **val) } else if (v->start == -1 && v->end == 0 && PM_TYPE(v->pm->node.flags) == PM_HASHED) { arrhashsetfn(v->pm, val, 1); + } else if ((PM_TYPE(v->pm->node.flags) == PM_HASHED)) { + freearray(val); + zerr("%s: attempt to set slice of associative array", + v->pm->node.nam); + return; } else { char **old, **new, **p, **q, **r; int pre_assignment_length; int post_assignment_length; int i; - if ((PM_TYPE(v->pm->node.flags) == PM_HASHED)) { - freearray(val); - zerr("%s: attempt to set slice of associative array", - v->pm->node.nam); - return; - } if ((v->flags & VALFLAG_INV) && unset(KSHARRAYS)) { if (v->start > 0) v->start--; |