From b64f7a8bcc7e1cf9983ec72febd084e404c0f1c9 Mon Sep 17 00:00:00 2001 From: Clint Adams Date: Sun, 28 Feb 2010 21:47:43 +0000 Subject: 27762: omit ssh known_hosts entries with port numbers from host completion. --- Completion/Unix/Type/_hosts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Completion/Unix/Type/_hosts') diff --git a/Completion/Unix/Type/_hosts b/Completion/Unix/Type/_hosts index c93399945..499caede1 100644 --- a/Completion/Unix/Type/_hosts +++ b/Completion/Unix/Type/_hosts @@ -41,9 +41,9 @@ if ! zstyle -a ":completion:${curcontext}:hosts" hosts _hosts; then for khostfile in $khostfiles; do if [[ -r $khostfile ]]; then - khosts=(${(s:,:)${(j:,:)${(u)${(f)"$(<$khostfile)"}%%[ |#]*}}}) + khosts=(${${(s:,:)${(j:,:)${(u)${(f)"$(<$khostfile)"}%%[ |#]*}}}:#*[\[\]]*}) if [[ -z $useip ]]; then - khosts=(${${khosts:#(#s)[0-9]##.[0-9]##.[0-9]##.[0-9]##(#e)}:#(#s)[0-9a-f:]##(#e)}) + khosts=(${${${khosts:#(#s)[0-9]##.[0-9]##.[0-9]##.[0-9]##(#e)}:#(#s)[0-9a-f:]##(#e)}:#*[\[\]]*}) fi _cache_hosts+=($khosts) fi -- cgit 1.4.1