summary refs log tree commit diff
diff options
context:
space:
mode:
authorOliver Kiddle <opk@zsh.org>2016-09-07 23:18:26 +0200
committerOliver Kiddle <opk@zsh.org>2016-09-07 23:18:26 +0200
commit5d24f6d9aa6c1f0af5e3f28be0472546e5471f7e (patch)
tree0715a9fca0538b9e05ad277d47af49257fa0bd07
parentef862262e72c51621aa4d9400a2395fdc4f2324f (diff)
downloadzsh-5d24f6d9aa6c1f0af5e3f28be0472546e5471f7e.tar.gz
zsh-5d24f6d9aa6c1f0af5e3f28be0472546e5471f7e.tar.xz
zsh-5d24f6d9aa6c1f0af5e3f28be0472546e5471f7e.zip
39193 (cf. Yoshio Hanawa: 39192): don't pass options from after -- on to compadd
-rw-r--r--ChangeLog5
-rw-r--r--Completion/Unix/Type/_remote_files15
2 files changed, 14 insertions, 6 deletions
diff --git a/ChangeLog b/ChangeLog
index c7c863c96..d3fe39a7f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2016-09-07  Oliver Kiddle  <opk@zsh.org>
+
+	39193: Completion/Unix/Type/_remote_files: don't pass options
+	from after -- on to compadd
+
 2016-09-07  Peter Stephenson  <p.w.stephenson@ntlworld.com>
 
 	* 39185: Src/lex.c: wordbeg only set for ZLE if not alias.
diff --git a/Completion/Unix/Type/_remote_files b/Completion/Unix/Type/_remote_files
index db3316422..54bd438eb 100644
--- a/Completion/Unix/Type/_remote_files
+++ b/Completion/Unix/Type/_remote_files
@@ -28,16 +28,19 @@
 
 
 # There should be coloring based on all the different ls -F classifiers.
-local expl rempat remfiles remdispf remdispd args cmd cmd_args suf ret=1
+local expl rempat remfiles remdispf remdispd args cmd suf ret=1
+local -a args cmd_args
 local glob host
 
 if zstyle -T ":completion:${curcontext}:files" remote-access; then
 
   # Parse options to _remote_files. Stops at the first "--".
   zparseopts -D -E -a args / g:=glob h:=host
-  shift
   (( $#host)) && shift host || host="${IPREFIX%:}"
 
+  args=( ${argv[1,(I)--]} )
+  shift ${#args}
+  args[-1]=()
   # Command to run on the remote system.
   cmd="$1"
   shift
@@ -45,9 +48,9 @@ if zstyle -T ":completion:${curcontext}:files" remote-access; then
   # Handle arguments to ssh.
   if [[ $cmd == ssh ]]; then
     zparseopts -D -E -a cmd_args p: 1 2 4 6 F:
-    cmd_args="-o BatchMode=yes $cmd_args -a -x"
+    cmd_args=( -o BatchMode=yes "$cmd_args[@]" -a -x )
   else
-    cmd_args="$@"
+    cmd_args=( "$@" )
   fi
 
   if [[ -z $QIPREFIX ]]
@@ -74,8 +77,8 @@ if zstyle -T ":completion:${curcontext}:files" remote-access; then
   while _tags; do
     while _next_label files expl ${suf:-remote directory}; do
       [[ -n $suf ]] &&
-          compadd "$@" "$expl[@]" -d remdispf ${(q)remdispf%[*=|]} && ret=0
-      compadd ${suf:+-S/} -r "/ \t\n\-" "$@" "$expl[@]" -d remdispd \
+          compadd "$args[@]" "$expl[@]" -d remdispf ${(q)remdispf%[*=|]} && ret=0
+      compadd ${suf:+-S/} -r "/ \t\n\-" "$args[@]" "$expl[@]" -d remdispd \
 	${(q)remdispd%/} && ret=0
     done
     (( ret )) || return 0