[Bash-completion-devel] [bash-completion-Bugs][313057] _get_comp_words_by_ref -n ... ends up lumping things it shouldn't

bash-completion-bugs at alioth.debian.org bash-completion-bugs at alioth.debian.org
Tue Mar 22 21:28:57 UTC 2011


Bugs item #313057, was opened at 2011-03-22 23:28 by Ville Skyttä 
You can respond by visiting: 
https://alioth.debian.org/tracker/?func=detail&atid=413095&aid=313057&group_id=100114

Status: Open
Priority: 4
Submitted By: Ville Skyttä  (scop-guest)
Assigned to: Freddy Vulto (fvu-guest)
Summary:  _get_comp_words_by_ref -n ... ends up lumping things it shouldn't 
Distribution: None
Originally reported in: None
Milestone: None
Status: None
Original bug number: 


Initial Comment:
I'm working on generic redirect handling for bash-completion, and while doing that I ran into what I think is a bug in _get_comp_words_by_ref -n ...:

_foo()
{
    local i words cword
    _get_comp_words_by_ref -n '<>' words cword
    echo
    for (( i=0; i < cword; i++ )); do
        echo "$i:'${words[i]}'"
    done
}
complete -F _foo foo

Now, try that out:

$ foo a b > c d <e <TAB>
0:'foo'
1:'a'
2:'b>c'
3:'d<e'

The way it ends up lumping words does not look right to me.  I would have expected this output instead:

0:'foo'
1:'a'
2:'b'
3:'>'
4:'c'
5:'d'
6:'<e'

Freddy or someone else who understands the gory details of _get_comp_words_by_ref(), could you have a look into this?  (It's a blocker for the stuff I mentioned at start of this report.) TIA!

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

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



More information about the Bash-completion-devel mailing list