zsh-workers
 help / color / mirror / code / Atom feed
From: Peter Stephenson <p.stephenson@samsung.com>
To: Zsh workers <zsh-workers@zsh.org>
Subject: Re: bug with completion in quotes
Date: Fri, 24 Oct 2014 09:51:21 +0100	[thread overview]
Message-ID: <20141024095121.18d24ea9@pwslap01u.europe.root.pri> (raw)
In-Reply-To: <20141022152802.5dc5bcb3@pwslap01u.europe.root.pri>

On Wed, 22 Oct 2014 15:28:02 +0100
Peter Stephenson <p.stephenson@samsung.com> wrote:
> I'm worried that
> 
> -		    if ((zlemetacs = ocs) > (i -= skipchars))
> +		    if ((zlemetacs = ocs) > i--)
> 
> should actually be
> 
> -		    if ((zlemetacs = ocs) > (i -= skipchars))
> +		    if ((zlemetacs = ocs) > --i)
> 
> In other words, I'm sure that only decrementing once is correct ---
> we're deleting characters ahead of the point we're looking at, so the
> decrement is simply to cancel out the effect of the ++i in the loop
> iterator --- but the --i is more consistent with what was there before.
> I'll try and puzzle out the exact meaning of the indices before I commit
> this.

I can't find a case where this seems to make a difference in practice.
If there's an off-by-one error remaining it's a very subtle one.

Given that, I'll commit this with the second change since it looks more
like what's there but with the definite bug removed.

pws


      reply	other threads:[~2014-10-24  9:01 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-11 22:37 Oliver Kiddle
2014-10-12  4:41 ` Bart Schaefer
2014-10-12 17:35 ` Peter Stephenson
2014-10-12 17:51   ` Peter Stephenson
2014-10-12 18:29     ` Bart Schaefer
2014-10-12 19:44       ` Peter Stephenson
2014-10-12 20:15         ` Peter Stephenson
2014-10-12 20:36           ` Bart Schaefer
2014-10-20 17:22 ` Peter Stephenson
2014-10-22 14:05   ` Oliver Kiddle
2014-10-22 14:28     ` Peter Stephenson
2014-10-24  8:51       ` Peter Stephenson [this message]

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=20141024095121.18d24ea9@pwslap01u.europe.root.pri \
    --to=p.stephenson@samsung.com \
    --cc=zsh-workers@zsh.org \
    /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).