Debian Bug report logs - #624703
bash-completion makes bash report an error and doesn't complete

version graph

Package: bash-completion; Maintainer for bash-completion is Gabriel F. T. Gomes <gabriel@debian.org>; Source for bash-completion is src:bash-completion (PTS, buildd, popcon).

Reported by: Frank Harwald <franki777@xmail.net>

Date: Sat, 30 Apr 2011 19:06:01 UTC

Severity: wishlist

Tags: confirmed, fixed-upstream, upstream

Merged with 622383

Found in versions 1.2-3, bash-completion/1:1.3-2

Fixed in version bash-completion/1:1.90-1

Done: David Paleino <dapal@debian.org>

Bug is archived. No further changes may be made.

Toggle useless messages

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to debian-bugs-dist@lists.debian.org, Bash Completion Maintainers <bash-completion-devel@lists.alioth.debian.org>:
Bug#624703; Package bash-completion. (Sat, 30 Apr 2011 19:06:04 GMT) (full text, mbox, link).


Acknowledgement sent to Frank Harwald <franki777@xmail.net>:
New Bug report received and forwarded. Copy sent to Bash Completion Maintainers <bash-completion-devel@lists.alioth.debian.org>. (Sat, 30 Apr 2011 19:06:04 GMT) (full text, mbox, link).


Message #5 received at submit@bugs.debian.org (full text, mbox, reply):

From: Frank Harwald <franki777@xmail.net>
To: submit@bugs.debian.org
Subject: bash-completion makes bash report an error and doesn't complete
Date: Sat, 30 Apr 2011 11:50:26 -0700
Package: bash-completion
Version: 1.2-3

There is a bug in bash-completion that makes it print out an error message when trying
to complete any command by hitting <TAB> when bash_completion is loaded and the current
command doesn't get any completion at all. It only works under special circumstances,
e.g. the command line must have a special kind of format and the cursor must be at a
specific position.

It prints out the following error message:
	any_command bash: $index: substring expression < 0
when trying to complete on any command that looks like this egrep-like regex(the bug
only occurs with whitespace and control characters used exactly as specified):
	 any_command (other_option)*[ ]+ last_option\n
	                  cursor is here^           ^
	line end is here(no space after last_option)|

here is an example that triggers the error. Type in the following into bash
> ls  -l
then put the cursor before the minus sign
> ls  -l
     ^cursor is here
than press <TAB> to complete. This is what you should get:
> ls bash: $index: substring expression < 0

I guess the bug is somewhere in __get_cword_at_cursor_by_ref or _get_cword, but I
wasn't able to fix it

It occurs on multiple versions of bash-completion 20080705, 1.2-3 and others probably
too. It also occurs on different versions of bash as well, tested on 3.2.39(1)-release,
4.1-3 and 4.1.7(1)-release on Debian Lenny, Squeeze and even on other Linux distributions.

Since this e-mail is sensitive to whitespaces and e-mail often mangles them, I've put
up a copy here: http://paste.debian.net/115602/






Information forwarded to debian-bugs-dist@lists.debian.org, Bash Completion Maintainers <bash-completion-devel@lists.alioth.debian.org>:
Bug#624703; Package bash-completion. (Sat, 30 Apr 2011 19:33:09 GMT) (full text, mbox, link).


Acknowledgement sent to dapal@debian.org:
Extra info received and forwarded to list. Copy sent to Bash Completion Maintainers <bash-completion-devel@lists.alioth.debian.org>. (Sat, 30 Apr 2011 19:33:09 GMT) (full text, mbox, link).


Message #10 received at 624703@bugs.debian.org (full text, mbox, reply):

From: David Paleino <dapal@debian.org>
To: Frank Harwald <franki777@xmail.net>
Cc: 624703@bugs.debian.org, 622383@bugs.debian.org
Subject: Re: [Bash-completion-devel] Bug#624703: bash-completion makes bash report an error and doesn't complete
Date: Sat, 30 Apr 2011 21:30:33 +0200
[Message part 1 (text/plain, inline)]
forcemerge 622383 624703
thanks

Hello,

On Sat, 30 Apr 2011 11:50:26 -0700, Frank Harwald wrote:

> Package: bash-completion
> Version: 1.2-3
> 
> There is a bug in bash-completion that makes it print out an error message
> when trying to complete any command by hitting <TAB> when bash_completion is
> loaded and the current command doesn't get any completion at all. It only
> works under special circumstances, e.g. the command line must have a special
> kind of format and the cursor must be at a specific position.
> 
> It prints out the following error message:
> 	any_command bash: $index: substring expression < 0
> [..]

Seems like a duplicate of #622383. Would you please test the patch linked there?

Kindly,
David

-- 
 . ''`.   Debian developer | http://wiki.debian.org/DavidPaleino
 : :'  : Linuxer #334216 --|-- http://www.hanskalabs.net/
 `. `'`  GPG: 1392B174 ----|---- http://deb.li/dapal
   `-   2BAB C625 4E66 E7B8 450A C3E1 E6AA 9017 1392 B174
[signature.asc (application/pgp-signature, attachment)]

Forcibly Merged 622383 624703. Request was from David Paleino <dapal@debian.org> to control@bugs.debian.org. (Sat, 30 Apr 2011 19:33:14 GMT) (full text, mbox, link).


Added tag(s) pending. Request was from David Paleino <dapal@debian.org> to control@bugs.debian.org. (Thu, 03 Nov 2011 12:06:08 GMT) (full text, mbox, link).


Bug archived. Request was from Debbugs Internal Request <owner@bugs.debian.org> to internal_control@bugs.debian.org. (Fri, 02 Dec 2011 07:31:47 GMT) (full text, mbox, link).


Send a report that this bug log contains spam.


Debian bug tracking system administrator <owner@bugs.debian.org>. Last modified: Sun Jul 2 10:09:52 2023; Machine Name: buxtehude

Debian Bug tracking system

Debbugs is free software and licensed under the terms of the GNU Public License version 2. The current version can be obtained from https://bugs.debian.org/debbugs-source/.

Copyright © 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson, 2005-2017 Don Armstrong, and many other contributors.