zsh-workers
 help / color / mirror / code / Atom feed
From: Wayne Davison <wayne@clari.net>
To: Zsh Workers <zsh-workers@sunsite.auc.dk>
Subject: Re: PATCH: fix for $var[1,0] expansion
Date: Tue, 30 May 2000 23:12:25 -0700 (PDT)	[thread overview]
Message-ID: <Pine.GSO.4.21.0005302254050.10370-100000@house.clari.net> (raw)
In-Reply-To: <Pine.GSO.4.21.0005302220580.10370-100000@house.clari.net>

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..


  reply	other threads:[~2000-05-31  6:12 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-05-31  5:45 Wayne Davison
2000-05-31  6:12 ` Wayne Davison [this message]
2000-05-31  6:24 ` Wayne Davison

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Pine.GSO.4.21.0005302254050.10370-100000@house.clari.net \
    --to=wayne@clari.net \
    --cc=zsh-workers@sunsite.auc.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).