Fix sed error in qdbus completions containing slashes (Debian: 552631).

This commit is contained in:
Ville Skyttä 2009-10-29 19:15:53 +02:00
parent 60ee2500bc
commit 1d74adc296
2 changed files with 4 additions and 7 deletions

View File

@ -26,6 +26,7 @@ bash-completion (2.x)
Marco Poletti (Alioth: #312021).
* Improve sourcing snippets from completion dirs.
* Drop support for bash < 3.
* Fix sed error in qdbus completions containing slashes (Debian: 552631).
-- David Paleino <d.paleino@gmail.com> Sun, 11 Oct 2009 11:11:57 +0200

View File

@ -7,13 +7,9 @@ _qdbus()
COMPREPLY=()
cur=`_get_cword`
if [ -z "$cur" ]; then
compstr=${COMP_WORDS[*]}
else
compstr=$( command echo ${COMP_WORDS[*]} | sed "s/ ${cur/\//\\/}$//" )
fi
COMPREPLY=( $( compgen -W '$( command $compstr | sed s/\(.*\)// )' \
-- "$cur" ) )
[ -n "$cur" ] && unset COMP_WORDS[${#COMP_WORDS[@]}-1]
COMPREPLY=( $( compgen -W '$( command ${COMP_WORDS[@]} | sed s/\(.*\)// )' \
-- "$cur" ) )
} &&
complete -F _qdbus qdbus