Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: PATCH: fix for $var[1,0] expansion
- X-seq: zsh-workers 11680
- From: Wayne Davison <wayne@xxxxxxxxx>
- To: Zsh Workers <zsh-workers@xxxxxxxxxxxxxx>
- Subject: Re: PATCH: fix for $var[1,0] expansion
- Date: Tue, 30 May 2000 23:12:25 -0700 (PDT)
- In-reply-to: <Pine.GSO.4.21.0005302220580.10370-100000@xxxxxxxxxxxxxxx>
- Mailing-list: contact zsh-workers-help@xxxxxxxxxxxxxx; run by ezmlm
One thing I just noticed is that the two "subscript too small/big"
error messages have never output the correct array value for one-
relative arrays. My just-released patch accidentally split the
difference so that it was only half right in 1-relative mode, but
also half right in ksh (0-relative) mode. This patch should fix it
so that it works right all the time.
Index: params.c
@@ -1312,13 +1312,13 @@
if (v->start > MAX_ARRLEN ||
v->start < -MAX_ARRLEN) {
zerr("subscript too %s: %d", (v->start < 0) ? "small" : "big",
- v->start);
+ v->start + !isset(KSHARRAYS));
return NULL;
}
if (v->start + v->len > MAX_ARRLEN ||
v->start + v->len < -MAX_ARRLEN) {
zerr("subscript too %s: %d", (v->len < 0) ? "small" : "big",
- v->start + v->len);
+ v->start + v->len - !!isset(KSHARRAYS));
return NULL;
}
return v;
..wayne..
Messages sorted by:
Reverse Date,
Date,
Thread,
Author