$COMP_POINT: substring expression < 0 when tabbing after Ctrl-R sudo

Bug #567141 reported by Alexey Kotlyarov
18
This bug affects 4 people
Affects Status Importance Assigned to Milestone
bash-completion (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

Binary package hint: bash-completion

After confirming a command found by Ctrl-R with Tab, if it starts with sudo, the command supplied is wrong, and there are error messages on the console.

How to reproduce:
1. Run "sudo echo test command" for it to be in the history.
2. Press Ctrl-R, type "sudo ec", press Tab.
3. Press Enter.

Expected results:
$ sudo echo test command
test command
$

Actual results:
After (2):
$ bash: $COMP_POINT: substring expression < 0
bash: $COMP_POINT: substring expression < 0
bash: COMP_WORDS: bad array subscript
--
After (3):
--sudo: command not found
$

ProblemType: Bug
DistroRelease: Ubuntu 10.04
Package: bash-completion 1:1.1-3ubuntu2
ProcVersionSignature: Ubuntu 2.6.32-21.32-generic 2.6.32.11+drm33.2
Uname: Linux 2.6.32-21-generic x86_64
NonfreeKernelModules: nvidia
Architecture: amd64
Date: Tue Apr 20 13:07:11 2010
PackageArchitecture: all
ProcEnviron:
 LANGUAGE=ru_RU:ru:en
 PATH=(custom, user)
 LANG=ru_RU.UTF-8
 SHELL=/bin/bash
SourcePackage: bash-completion

Revision history for this message
Alexey Kotlyarov (koterpillar) wrote :
Revision history for this message
Zeth (zeth0) wrote :

I also get:

$ bash: $COMP_POINT: substring expression < 0
bash: $COMP_POINT: substring expression < 0
bash: COMP_WORDS: bad array subscript

Revision history for this message
Pablo (palas87) wrote :

I will say the problem is more general.

The error is displayed anytime you try to auto-complete when you are at the beginning of the line in the history.

For example: (provided you have history)
Press UP, press HOME, press TAB.

DistroRelease: Ubuntu 10.04
Package: bash-completion 1:1.1-3ubuntu2
Uname: Linux 2.6.32-26-generic x86_64
NonfreeKernelModules: nvidia
Architecture: amd64
Date: Tue Dic 9 23:02:33 2010
PackageArchitecture: all
SourcePackage: bash-completion

Revision history for this message
Peter Cordes (peter-cordes) wrote :

Not seeing this in Trusty. Assuming fixed somewhere between then and now.

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

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.