zsh-workers
 help / color / mirror / code / Atom feed
From: Wayne Davison <wayned@users.sourceforge.net>
To: Zsh Workers <zsh-workers@sunsite.auc.dk>
Subject: PATCH: glob-array indexing fix
Date: Fri, 2 Jun 2000 03:23:20 -0700 (PDT)	[thread overview]
Message-ID: <Pine.LNX.4.21.0006020315310.5302-100000@phong.blorf.net> (raw)

I just added some more array-indexing tests to the new 14array.ztst
file (which is run by "make check").  In so doing I noticed that the
glob-array indexing was not working right in my latest patch.  The fix
is trivial:

Index: Src/glob.c
@@ -1435,7 +1435,7 @@
 	end += matchct + 1;
     else if (end > matchct)
 	end = matchct;
-    if (end -= first > 0) {
+    if ((end -= first) > 0) {
 	matchptr = matchbuf + matchct - first - end;
 	while (end-- > 0) {		/* insert matches in the arg list */
 	    insertlinknode(list, node, matchptr->name);

It's nice to know that the test suite will now catch this if it ever
breaks again.  After this change, the new array code looks solid to
me.

..wayne..


                 reply	other threads:[~2000-06-02 10:23 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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.LNX.4.21.0006020315310.5302-100000@phong.blorf.net \
    --to=wayned@users.sourceforge.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).