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.
This commit is contained in:
parent
0209fbde2c
commit
1064bb1c14
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user