Merge pull request #1253 from scop/bash-completion-globbing

bash completion: avoid unintentional globbing
This commit is contained in:
Hiroshi SHIBATA 2020-08-09 08:13:04 +09:00 committed by GitHub
commit 0843745be9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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