All of lore.kernel.org
 help / color / mirror / Atom feed
From: "SZEDER Gábor" <szeder@ira.uka.de>
To: Jonathan Nieder <jrnieder@gmail.com>
Cc: "SZEDER Gábor" <szeder@ira.uka.de>, "Jeff King" <peff@peff.net>,
	"Sverre Rabbelier" <srabbelier@gmail.com>,
	"Git List" <git@vger.kernel.org>,
	"Shawn O. Pearce" <gsoc@spearce.org>,
	"Stephen Boyd" <bebarino@gmail.com>
Subject: Re: [BUG] Autocompletion fails with "bash: words: bad array subscript"
Date: Wed, 11 May 2011 23:09:41 +0200	[thread overview]
Message-ID: <20110511210941.GC31029@goldbirke> (raw)
In-Reply-To: <20110510234552.GG1994@elie>

Hi,


On Tue, May 10, 2011 at 06:45:52PM -0500, Jonathan Nieder wrote:
> SZEDER Gábor wrote:
> > So the bug is definitely not git-related.  The fix would be a check
> > along the lines of the first two hunks of the patch I just sent out.
> 
> FWIW it looks like the bash-completion lib adopted a different fix
> recently: see [1] (_init_completion: Indicate that completion should
> not continue if cword == 0, 2011-05-02).
> 
> [1] http://git.debian.org/?p=bash-completion/bash-completion.git;a=commitdiff;h=457dbf6061eea5f2d1e3bccacf1691265f7321cc

That doesn't fix the issue at hand.  _init_completion() invokes
_get_comp_words_by_ref() before that check to set all variables [1],
which will in turn try to access the -1th element of the array when
setting $prev, producing the same error.


Best,
Gábor


[1]: http://git.debian.org/?p=bash-completion/bash-completion.git;a=blob;f=bash_completion;h=e88e2fc8cd97f2a43173b45a1448451bb53e55ab;hb=457dbf6061eea5f2d1e3bccacf1691265f7321cc#l708

  reply	other threads:[~2011-05-11 21:10 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-10 20:13 [BUG] Autocompletion fails with "bash: words: bad array subscript" Sverre Rabbelier
2011-05-10 20:31 ` Jeff King
2011-05-10 20:39   ` Jeff King
2011-05-10 20:47     ` Sverre Rabbelier
2011-05-10 21:01       ` Jeff King
2011-05-10 21:02         ` Sverre Rabbelier
2011-05-10 21:10           ` Jeff King
2011-05-10 22:39             ` SZEDER Gábor
2011-05-10 23:45               ` Jonathan Nieder
2011-05-11 21:09                 ` SZEDER Gábor [this message]
2011-05-10 22:14 ` [PATCH] completion: fix array indexing error after reverse history search SZEDER Gábor
2011-05-10 22:19   ` Sverre Rabbelier

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=20110511210941.GC31029@goldbirke \
    --to=szeder@ira.uka.de \
    --cc=bebarino@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gsoc@spearce.org \
    --cc=jrnieder@gmail.com \
    --cc=peff@peff.net \
    --cc=srabbelier@gmail.com \
    /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.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.