From 3023ddf132825bb29c94fbd0860b7785887cc5c5 Mon Sep 17 00:00:00 2001 From: Oliver Kiddle Date: Tue, 30 Mar 2004 16:35:30 +0000 Subject: 19707: negative index into arrays should return scalar and not one element array --- Src/params.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'Src') diff --git a/Src/params.c b/Src/params.c index 49c3a93d7..134355173 100644 --- a/Src/params.c +++ b/Src/params.c @@ -1272,13 +1272,14 @@ getindex(char **pptr, Value v, int dq) } else { end = we ? we : start; } + if (start != end) com = 1; if (start > 0) start--; else if (start == 0 && end == 0) end++; if (s == tbrack) { s++; - if (v->isarr && start == end-1 && !com && + if (v->isarr && !com && (!(v->isarr & SCANPM_MATCHMANY) || !(v->isarr & (SCANPM_MATCHKEY | SCANPM_MATCHVAL | SCANPM_KEYMATCH)))) -- cgit 1.4.1