summaryrefslogtreecommitdiffstats
path: root/shell
diff options
context:
space:
mode:
authorGene Pavlovsky <gene.pavlovsky@gmail.com>2016-04-23 03:12:15 +0300
committerGene Pavlovsky <gene.pavlovsky@gmail.com>2016-04-23 03:12:15 +0300
commite2401350a367fbfcd52852ec3c76109fa831016a (patch)
tree3b87d56c4115b26703af0637703b64551ba5c530 /shell
parente867355b2a578438d08b74a1708d6ad582316a48 (diff)
Update completion.bash
Fixes #548. Avoid using a subshell in _fzf_defc().
Diffstat (limited to 'shell')
-rw-r--r--shell/completion.bash5
1 files changed, 3 insertions, 2 deletions
diff --git a/shell/completion.bash b/shell/completion.bash
index 9005af70..66fac61d 100644
--- a/shell/completion.bash
+++ b/shell/completion.bash
@@ -272,14 +272,15 @@ if type _completion_loader > /dev/null 2>&1; then
fi
_fzf_defc() {
- local cmd func opts orig_var orig
+ local cmd func opts orig_var orig def
cmd="$1"
func="$2"
opts="$3"
orig_var="_fzf_orig_completion_$cmd"
orig="${!orig_var}"
if [ -n "$orig" ]; then
- eval "$(printf "$orig" "$func")"
+ printf -v def "$orig" "$func"
+ eval "$def"
else
complete -F "$func" $opts "$cmd"
fi