about summary refs log tree commit diff
path: root/Functions/Zftp/zfrglob
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2007-07-03 17:06:04 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2007-07-03 17:06:04 +0000
commit876fa2c44e0a17b2d10a2547ac1d13687cfed520 (patch)
treef92ce7475c97f82a05e20e9ba8be9b83436c9b6b /Functions/Zftp/zfrglob
parent6fa964914d8be709b1145399108ef1535a0b3f39 (diff)
downloadzsh-876fa2c44e0a17b2d10a2547ac1d13687cfed520.tar.gz
zsh-876fa2c44e0a17b2d10a2547ac1d13687cfed520.tar.xz
zsh-876fa2c44e0a17b2d10a2547ac1d13687cfed520.zip
unposted: force latest version of files from vendor to main branch
Diffstat (limited to 'Functions/Zftp/zfrglob')
-rw-r--r--Functions/Zftp/zfrglob17
1 files changed, 8 insertions, 9 deletions
diff --git a/Functions/Zftp/zfrglob b/Functions/Zftp/zfrglob
index f9d67b3f2..1fb8d761a 100644
--- a/Functions/Zftp/zfrglob
+++ b/Functions/Zftp/zfrglob
@@ -9,7 +9,8 @@
 #      stick with a single directory.  This is the default.
 #  (2) Use remote globbing, i.e. pass it to ls at the site.
 #      Faster, but only works with UNIX, and only basic globbing.
-#      We do this if $zfrglob is non-null.
+#      We do this if the remote-glob style (or $zfrglob for
+#      backward compatibility) is set.
 
 # There is only one argument, the variable containing the
 # pattern to be globbed.  We set this back to an array containing
@@ -18,7 +19,9 @@
 emulate -L zsh
 setopt extendedglob
 
-local pat dir nondir files i
+local pat dir nondir files i zfrglob
+
+zstyle -t "$curcontext" remote-glob && zfrglob=1
 
 eval pat=\$$1
 
@@ -52,14 +55,10 @@ else
     rm -f $tmpf
   else
     # we just have to do an ls and hope that's right
+    local fcache_name
+    zffcache
     nondir=$pat
-    if (( $#zftp_fcache == 0 )); then
-      # Why does `zftp_fcache=($(zftp ls))' sometimes not work?
-      zftp ls >$tmpf
-      zftp_fcache=($(<$tmpf))
-      rm -f $tmpf
-    fi
-    files=($zftp_fcache)
+    files=(${(P)fcache_name})
   fi
   # now we want to see which of the $files match $nondir:
   # ${...:/foo} deletes occurrences of foo matching a complete word,