about summary refs log tree commit diff
diff options
context:
space:
mode:
authorClint Adams <clint@users.sourceforge.net>2010-02-28 21:47:43 +0000
committerClint Adams <clint@users.sourceforge.net>2010-02-28 21:47:43 +0000
commitb64f7a8bcc7e1cf9983ec72febd084e404c0f1c9 (patch)
tree49a8c5383355091d7ecc3ca8b066db8d5005be1a
parent21193d7f0128dc66f4c41c7b06d1d20c5b9339fc (diff)
downloadzsh-b64f7a8bcc7e1cf9983ec72febd084e404c0f1c9.tar.gz
zsh-b64f7a8bcc7e1cf9983ec72febd084e404c0f1c9.tar.xz
zsh-b64f7a8bcc7e1cf9983ec72febd084e404c0f1c9.zip
27762: omit ssh known_hosts entries with port numbers from host completion.
-rw-r--r--ChangeLog7
-rw-r--r--Completion/Unix/Type/_hosts4
2 files changed, 8 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index ed70e59f5..013855ac3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2010-02-28  Clint Adams  <clint@zsh.org>
+
+	* 27762: Completion/Unix/Type/_hosts: omit ssh known_hosts
+	entries with port numbers from host completion.
+
 2010-02-27  Peter Stephenson  <p.w.stephenson@ntlworld.com>
 
 	* users/14905 (modified, see users/14096): Doc/Zsh/expn.yo,
@@ -12849,5 +12854,5 @@
 
 *****************************************************
 * This is used by the shell to define $ZSH_PATCHLEVEL
-* $Revision: 1.4921 $
+* $Revision: 1.4922 $
 *****************************************************
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