about summary refs log tree commit diff
diff options
context:
space:
mode:
authorBart Schaefer <barts@users.sourceforge.net>2005-05-09 02:38:32 +0000
committerBart Schaefer <barts@users.sourceforge.net>2005-05-09 02:38:32 +0000
commit627cafd9db0c3d06e4a742345a78b175ab6b5116 (patch)
tree5275c31ae3e4690fe386d1a5f574583e0ca6a75c
parentd400f3f570bf20e19a0adc322d5132049a002e29 (diff)
downloadzsh-627cafd9db0c3d06e4a742345a78b175ab6b5116.tar.gz
zsh-627cafd9db0c3d06e4a742345a78b175ab6b5116.tar.xz
zsh-627cafd9db0c3d06e4a742345a78b175ab6b5116.zip
21235,21236: fixes to _remote_files
-rw-r--r--ChangeLog5
-rw-r--r--Completion/Unix/Command/_ssh9
2 files changed, 12 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 5fa82e7e2..a254f0a32 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2005-05-08  Bart Schaefer  <schaefer@zsh.org>
+
+	* 21235, 21236: Completion/Unix/Command/_ssh: fix remote filename
+	quoting and wrong exit status, both in _remote_files.
+
 2005-05-07  Clint Adams  <clint@zsh.org>
 
 	* Jesse Weinstein: 21233: Completion/Debian/Command/_dpkg:
diff --git a/Completion/Unix/Command/_ssh b/Completion/Unix/Command/_ssh
index 399da1230..b4b739019 100644
--- a/Completion/Unix/Command/_ssh
+++ b/Completion/Unix/Command/_ssh
@@ -2,11 +2,15 @@
 
 _remote_files () {
   # There should be coloring based on all the different ls -F classifiers.
-  local expl remfiles remdispf remdispd args suf ret=1
+  local expl rempat remfiles remdispf remdispd args suf ret=1
 
   if zstyle -T ":completion:${curcontext}:files" remote-access; then
     zparseopts -D -E -a args p: 1 2 4 6 F:
-    remfiles=(${(M)${(f)"$(_call_program files ssh $args -a -x ${IPREFIX%:} ls -d1FL "${(Q)PREFIX%%[^./][^/]#}\*" 2>/dev/null)"}%%[^/]#(|/)})
+    if [[ -z $QIPREFIX ]]
+    then rempat="${PREFIX%%[^./][^/]#}\*"
+    else rempat="${(q)PREFIX%%[^./][^/]#}\*"
+    fi
+    remfiles=(${(M)${(f)"$(_call_program files ssh $args -a -x ${IPREFIX%:} ls -d1FL "$rempat" 2>/dev/null)"}%%[^/]#(|/)})
     compset -P '*/'
     compset -S '/*' || suf='remote file'
 
@@ -23,6 +27,7 @@ _remote_files () {
       done
       (( ret )) || return 0
     done
+    return ret
   else
     _message -e remote-files 'remote file'
   fi