about summary refs log tree commit diff
path: root/Functions/Zftp/zfcd_match
diff options
context:
space:
mode:
Diffstat (limited to 'Functions/Zftp/zfcd_match')
-rw-r--r--Functions/Zftp/zfcd_match9
1 files changed, 5 insertions, 4 deletions
diff --git a/Functions/Zftp/zfcd_match b/Functions/Zftp/zfcd_match
index e034ca016..16de5c81c 100644
--- a/Functions/Zftp/zfcd_match
+++ b/Functions/Zftp/zfcd_match
@@ -1,6 +1,7 @@
 # function zfcd_match {
 
 emulate -L zsh
+setopt extendedglob
 
 # see zfcd for details of this hack
 if [[ $1 = $HOME || $1 = $HOME/* ]]; then
@@ -24,10 +25,10 @@ if [[ $ZFTP_SYSTEM = UNIX* ]]; then
   fi
   # If we're using -F, we get away with using a directory
   # to list, but not a glob.  Don't ask me why.
-  # I hate having to rely on awk here.
-  zftp ls -LF $dir >$tmpf
-  reply=($(awk '/\/$/ { print substr($1, 1, length($1)-1) }' $tmpf))
-  rm -f $tmpf
+  reply=(${${(M)${(f)"$(zftp ls -lF $dir)"}:#d*}/(#b)*[[:space:]](*)\//$match[1]})
+#  zftp ls -LF $dir >$tmpf
+#  reply=($(awk '/\/$/ { print substr($1, 1, length($1)-1) }' $tmpf))
+#  rm -f $tmpf
   [[ -n $dir && $dir != */ ]] && dir="$dir/"
   if [[ -n $WIDGET ]]; then
     _wanted directories expl 'remote directory' \