From 1064bb1c14e2c86c69e58e3fa30f481a79286f59 Mon Sep 17 00:00:00 2001 From: Freddy Vulto Date: Sat, 28 Nov 2009 17:44:33 +0100 Subject: [PATCH] Removed array parameter expansion The testsuite failed on _known_hosts_real on bash-3. After long searching, it appears that on bash-3 (not bash-4) array expansion with a modified IFS causes the array to merge into a single item (!). See also: http://www.mail-archive.com/bug-bash@gnu.org/msg06520.html The effect was that multiple UserKnownHostsFiles in one config file weren't detected properly. The faulting parameter expansion ("${tmpkh[@]//\"/}) actually isn't necessary anymore, since eval is done now, so it is removed. --- bash_completion | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bash_completion b/bash_completion index 2b528af0..05f5c912 100644 --- a/bash_completion +++ b/bash_completion @@ -1265,7 +1265,7 @@ _known_hosts_real() # spaces in their name work (watch out for ~ expansion # breakage! Alioth#311595) tmpkh=( $( sed -ne 's/^[ \t]*\([Gg][Ll][Oo][Bb][Aa][Ll]\|[Uu][Ss][Ee][Rr]\)[Kk][Nn][Oo][Ww][Nn][Hh][Oo][Ss][Tt][Ss][Ff][Ii][Ll][Ee]['"$'\t '"']*\(.*\)$/\2/p' "${config[@]}" | sort -u ) ) - for i in "${tmpkh[@]//\"/}"; do + for i in "${tmpkh[@]}"; do i=$( eval echo "$i" ) # expand ~ [ -r "$i" ] && kh=( "${kh[@]}" "$i" ) done