bash completion: avoid unintentional globbing

This commit is contained in:
Ville Skyttä 2020-05-26 22:31:38 +03:00
parent c879cb0f2f
commit 8bc71e9161

View file

@ -6,8 +6,8 @@ _rbenv() {
COMPREPLY=( $(compgen -W "$(rbenv commands)" -- "$word") )
else
local words=("${COMP_WORDS[@]}")
unset words[0]
unset words[$COMP_CWORD]
unset "words[0]"
unset "words[$COMP_CWORD]"
local completions=$(rbenv completions "${words[@]}")
COMPREPLY=( $(compgen -W "$completions" -- "$word") )
fi