mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-10-29 17:31:02 +01:00
39937: fix a problem introduced by 39886.
$a[i,j] should become an empty array if i>j.
This commit is contained in:
parent
99acd1e7f4
commit
3fd50d06a1
2 changed files with 9 additions and 3 deletions
|
|
@ -2292,10 +2292,11 @@ getarrvalue(Value v)
|
|||
v->end += arrlen(s) + 1;
|
||||
|
||||
/* Null if 1) array too short, 2) index still negative */
|
||||
if (arrlen_lt(s, v->start) || v->start < 0) {
|
||||
if (v->end <= v->start) {
|
||||
s = arrdup_max(nular, 0);
|
||||
}
|
||||
else if (arrlen_lt(s, v->start) || v->start < 0) {
|
||||
s = arrdup_max(nular, 1);
|
||||
} else if (v->end <= v->start) {
|
||||
s = arrdup_max(nular, 0);
|
||||
} else {
|
||||
/* Copy to a point before the end of the source array:
|
||||
* arrdup_max will copy at most v->end - v->start elements,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue