From e2401350a367fbfcd52852ec3c76109fa831016a Mon Sep 17 00:00:00 2001 From: Gene Pavlovsky Date: Sat, 23 Apr 2016 03:12:15 +0300 Subject: Update completion.bash Fixes #548. Avoid using a subshell in _fzf_defc(). --- shell/completion.bash | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'shell') 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 -- cgit v1.2.3