[bash] Fix infinite loop on tab completion

awk may not set OFS to match FS depending on the implementation.

Close #1227
This commit is contained in:
Junegunn Choi 2018-04-30 12:58:10 +09:00
parent 6eac4af7db
commit 87504a528e
No known key found for this signature in database
GPG Key ID: 254BC280FEF9C627

View File

@ -39,7 +39,7 @@ __fzfcmd_complete() {
__fzf_orig_completion_filter() {
sed 's/^\(.*-F\) *\([^ ]*\).* \([^ ]*\)$/export _fzf_orig_completion_\3="\1 %s \3 #\2"; [[ "\1" = *" -o nospace "* ]] \&\& [[ ! "$__fzf_nospace_commands" = *" \3 "* ]] \&\& __fzf_nospace_commands="$__fzf_nospace_commands \3 ";/' |
awk -F= '{gsub(/[^A-Za-z0-9_= ;]/, "_", $1);}1'
awk -F= '{OFS = FS} {gsub(/[^A-Za-z0-9_= ;]/, "_", $1);}1'
}
_fzf_opts_completion() {