Skip to content

Commit 9691f09

Browse files
committed
refactor(known_hosts_real): use _comp_split for known_hosts filenames
1 parent 7a124f9 commit 9691f09

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

bash_completion

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2415,7 +2415,7 @@ _known_hosts_real()
24152415
# spaces in their name work (watch out for ~ expansion
24162416
# breakage! Alioth#311595)
24172417
if _comp_split -l tmpkh "$(awk 'sub("^[ \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=]+", "") { print $0 }' "${config[@]}" | sort -u)"; then
2418-
local j
2418+
local tmpkh2 j
24192419
for i in "${tmpkh[@]}"; do
24202420
# First deal with quoted entries...
24212421
while [[ $i =~ ^([^\"]*)\"([^\"]*)\"(.*)$ ]]; do
@@ -2425,7 +2425,8 @@ _known_hosts_real()
24252425
[[ -r $j ]] && kh+=("$j")
24262426
done
24272427
# ...and then the rest.
2428-
for j in $i; do
2428+
_comp_split tmpkh2 "$i" || continue
2429+
for j in "${tmpkh2[@]}"; do
24292430
__expand_tilde_by_ref j # Eval/expand possible `~' or `~user'
24302431
[[ -r $j ]] && kh+=("$j")
24312432
done

0 commit comments

Comments
 (0)