about summary refs log tree commit diff
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2007-03-25 12:51:43 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2007-03-25 12:51:43 +0000
commit7072c10ae223e24f601b3ee99e89dfcc35397122 (patch)
treec11c5224f77a4ae8a632a2041b36d9817e414822
parentc5ac4796428d1f2bb688e0fa4e593b476bc0ba4a (diff)
downloadzsh-7072c10ae223e24f601b3ee99e89dfcc35397122.tar.gz
zsh-7072c10ae223e24f601b3ee99e89dfcc35397122.tar.xz
zsh-7072c10ae223e24f601b3ee99e89dfcc35397122.zip
users/11333: fix users-hosts for ssh when user matched
-rw-r--r--ChangeLog6
-rw-r--r--Completion/Unix/Command/_ssh5
2 files changed, 9 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index f38f5ae5a..c0404b199 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2007-03-25  Peter Stephenson  <p.w.stephenson@ntlworld.com>
+
+	* usres/11333: Completion/Unix/Command/_ssh: users-hosts
+	didn't limit the hosts properly when the user was matched
+	for ssh.
+
 2007-03-24  Clint Adams  <clint@zsh.org>
 
 	* 23236: Daniel Qarras: Completion/Unix/Command/_module:
diff --git a/Completion/Unix/Command/_ssh b/Completion/Unix/Command/_ssh
index 11be5d1d0..c52b38c3e 100644
--- a/Completion/Unix/Command/_ssh
+++ b/Completion/Unix/Command/_ssh
@@ -326,11 +326,12 @@ _ssh_hosts () {
   local config
   integer ind
 
+  # If users-hosts matches, we shouldn't complete anything else.
   if [[ "$IPREFIX" == *@ ]]; then
-    _combination -s '[:@]' my-accounts users-hosts "users=${IPREFIX/@}" hosts "$@"
+    _combination -s '[:@]' my-accounts users-hosts "users=${IPREFIX/@}" hosts "$@" && return
   else
     _combination -s '[:@]' my-accounts users-hosts \
-      ${opt_args[-l]:+"users=${opt_args[-l]:q}"} hosts "$@"
+      ${opt_args[-l]:+"users=${opt_args[-l]:q}"} hosts "$@" && return
   fi
   if (( ind = ${words[(I)-F]} )); then
     config=${~words[ind+1]}