mirror of
https://github.com/zsh-users/zsh
synced 2024-10-07 08:30:06 +00: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
|
@ -1,3 +1,8 @@
|
|||
2016-11-15 Jun-ichi Takimoto <takimoto-j@kba.biglobe.ne.jp>
|
||||
|
||||
* 39937: Src/params.c: fix a problem introduced by 39886.
|
||||
$a[i,j] should become an empty array if i>j.
|
||||
|
||||
2016-11-14 Peter Stephenson <p.stephenson@samsung.com>
|
||||
|
||||
* 39906: Src/utils.c: More optimisation of multibyte handling
|
||||
|
|
|
@ -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…
Reference in a new issue