Don't overwrite other completions when completing from multiple SSH known hosts files.

This commit is contained in:
Ville Skyttä 2009-10-20 20:05:30 +03:00
parent 44395aa45f
commit 1ce1e0d452
2 changed files with 3 additions and 1 deletions

View File

@ -18,6 +18,8 @@ bash-completion (1.x)
* Improve cvs, gkrellm, lftp, mdadm, and mysqladmin completions.
* Add wtf completion, based on work by Raphaël Droz.
* Add lftpget completion.
* Don't overwrite other host completions when completing from multiple
SSH known hosts files.
-- David Paleino <d.paleino@gmail.com> Sun, 11 Oct 2009 11:11:57 +0200

View File

@ -1279,7 +1279,7 @@ _known_hosts_real()
if [ ${#kh[@]} -gt 0 ]; then
# FS needs to look for a comma separated list
COMPREPLY=( $( awk 'BEGIN {FS=","}
COMPREPLY=( "${COMPREPLY[@]}" $( awk 'BEGIN {FS=","}
/^\s*[^|\#]/ {for (i=1; i<=2; ++i) { \
gsub(" .*$", "", $i); \
gsub("[\\[\\]]", "", $i); \