[Bash-completion-devel] [bash-completion-Bugs][312740] _get_comp_words_by_ref with -n loses $prev

bash-completion-bugs at alioth.debian.org bash-completion-bugs at alioth.debian.org
Tue Oct 5 17:57:51 UTC 2010


Bugs item #312740, was changed at 2010-10-04 20:58 by Freddy Vulto
You can respond by visiting: 
https://alioth.debian.org/tracker/?func=detail&atid=413095&aid=312740&group_id=100114

Status: Open
Priority: 3
Submitted By: Ville Skyttä  (scop-guest)
>Assigned to: Freddy Vulto (fvu-guest)
Summary: _get_comp_words_by_ref with -n loses $prev 
Distribution: None
Originally reported in: None
Milestone: None
Status: None
Original bug number: 


Initial Comment:
With -n, _get_comp_words_by_ref fails to set $prev at least when current word to be completed is empty and some words contained the characters supposed to be excluded with -n.

Quick and dirty test:

-------------
foo() {
    local cur prev words
    _get_comp_words_by_ref -n : cur prev words
    echo
    echo "  cur:'$cur'"
    echo " prev:'$prev'"
    echo "words:'${words[@]}'"
} &&
complete -F foo foo
-------------

Now, try completions like "foo a b:c <TAB>", "foo a:b <TAB>" (note space before <TAB>).  cur and words seem to end up with the expected contents, but prev is empty.  If there are no colons in the words to be completed, prev is populated ok as well.  This is bash version 4.1.7(1)-release on Fedora 13, current bash completion git.

----------------------------------------------------------------------

You can respond by visiting: 
https://alioth.debian.org/tracker/?func=detail&atid=413095&aid=312740&group_id=100114



More information about the Bash-completion-devel mailing list