[Bash-completion-devel] Bash programmable completion breaks when used in history search context

Guillaume Rousse Guillaume.Rousse at inria.fr
Sun Jan 3 18:00:06 UTC 2010


Le 21/11/2009 16:15, Guillaume Rousse a écrit :
> As reported by a mandriva user:
> https://qa.mandriva.com/show_bug.cgi?id=54845
This is actually triggered by the completion code called with
COMP_CWORD=0, meaning prev=${COMP_WORDS[COMP_CWORD-1]} will trigger an
error.

BTW, this is not mandriva, nor urpmi specific: the issue can easily get
reproduced with any other completion, such as ssh, for instance:

[guillaume at oberkampf bash-completion (master)]$
(reverse-i-search)`ssh ': ssh -a oberkampf
<TAB>
[guillaume at oberkampf bash-completion (master)]$ bash: COMP_WORDS: bad
array subscript

I just modified  _get_pword to avoid this potential error. Completion in
history search context is still quite useless, but at least it doesn't
output error.

-- 
BOFH excuse #181:

Atilla the Hub



More information about the Bash-completion-devel mailing list