From 299f7b611b2a757098e5ccd3b439d94d1e2c309c Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Fri, 9 Sep 2016 00:30:58 +1200 Subject: Add IFS clearing before filename/branch reads --- bash/bash_completion.d/git.bash | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'bash') diff --git a/bash/bash_completion.d/git.bash b/bash/bash_completion.d/git.bash index ba8e5d59..8e10910b 100644 --- a/bash/bash_completion.d/git.bash +++ b/bash/bash_completion.d/git.bash @@ -39,7 +39,7 @@ _git() { # Complete with untracked, unignored files add) local file - while read -rd '' file ; do + while IFS= read -rd '' file ; do [[ -n $file ]] || continue COMPREPLY[${#COMPREPLY[@]}]=$file done < <(git ls-files \ @@ -55,7 +55,7 @@ _git() { # Complete with ref names *) local ref - while read -r ref ; do + while IFS= read -r ref ; do [[ -n $ref ]] || continue COMPREPLY[${#COMPREPLY[@]}]=${ref#refs/*/} done < <(git for-each-ref \ -- cgit v1.2.3