bash autocompletion giving COMP_WORDS with &&

Bug #366446 reported by Jesse_Adkins on 2009-04-24
This bug affects 3 people
Affects Status Importance Assigned to Milestone
bash-completion (Ubuntu)

Bug Description

Binary package hint: bash

Ubuntu Version : 9.04
Program Version : 3.2-5ubuntu1
Steps to reproduce :
Fire up the terminal and type the following

make &&

Now press tab like so :

make <tab> &&

(It's important that you _not_ press tab right next to &&. It has to be in the middle.)

When I do this, I get the following message
 bash: COMP_CWORD]: bad array subscript

I tried doing this with a few other utilities : ls, man, apt-get, and time. Every time I got at least one or more COMP_WORD error messages. time was the only one that gave an infinite loop of COMP_WORD messages.

Matthias Klose (doko) on 2009-08-24
affects: bash (Ubuntu) → bash-completion (Ubuntu)
Ruud Koot (ruudkoot) wrote :

additional examples:

cat<space 1><space2>|

putting your cursor on the second space and pressing tab results in:

bash: COMP_CWORD]: bad array subscript


putting the cursor on the the second space and pressing tab results in:

bash: $index: substring expression < 0

Rorzik (rorzik) wrote :

I confirm this in bash 3.2-5ubuntu1 on 9.04, and that it's still present in bash 4.0-5ubuntu2 on 9.10.
It only triggers for the commands with special completion processing. For example:
cd /tmp
cp /bin/cat cat
./cat<space><space>foo (tab between spaces triggers error "-bash: $index: substring expression < 0")
cp /bin/cat test
./test<space><space>foo (tab between spaces does NOT trigger an error)

Clint Byrum (clint-fewbar) wrote :

I am unable to reproduce this on 9.10, 10.04, or natty.

Can somebody please provide the exact version of bash-completion that this occurs with?

Marking Incomplete pending responses.

Changed in bash-completion (Ubuntu):
status: New → Incomplete
Jesse_Adkins (jesse-adkins7) wrote :

I tried my own test and the test documented in #2 using bash-completion 1:1.1-3ubuntu2 and I can't reproduce the problem. I'm not sure what I used to show the problem in the first place, but it seems to be fixed.

Vladimir Rutsky (rutsky) wrote :

I think this bug is same as #692562.

Launchpad Janitor (janitor) wrote :

[Expired for bash-completion (Ubuntu) because there has been no activity for 60 days.]

Changed in bash-completion (Ubuntu):
status: Incomplete → Expired
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers