about summary refs log tree commit diff
path: root/Functions
diff options
context:
space:
mode:
authorHan Pingtian <hanpt@linux.vnet.ibm.com>2015-05-26 15:53:47 +0800
committerPeter Stephenson <pws@zsh.org>2015-05-26 09:46:25 +0100
commit9a6f55dc7a047a07fe40fb52a1badf62e4917c98 (patch)
tree72a14d6fc29617d4d7d292700d6f3bcd393787a8 /Functions
parentd2f0b3ccb2be6dc2c600ef27b520ef89f9080dc1 (diff)
downloadzsh-9a6f55dc7a047a07fe40fb52a1badf62e4917c98.tar.gz
zsh-9a6f55dc7a047a07fe40fb52a1badf62e4917c98.tar.xz
zsh-9a6f55dc7a047a07fe40fb52a1badf62e4917c98.zip
35295: Try harder with zftp directory listing
Diffstat (limited to 'Functions')
-rw-r--r--Functions/Zftp/zfcd_match8
1 files changed, 7 insertions, 1 deletions
diff --git a/Functions/Zftp/zfcd_match b/Functions/Zftp/zfcd_match
index 9159f496c..d977983bf 100644
--- a/Functions/Zftp/zfcd_match
+++ b/Functions/Zftp/zfcd_match
@@ -25,7 +25,13 @@ 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.
-  reply=(${${(M)${(f)"$(zftp ls -lF $dir)"}:#d*}/(#b)*[[:space:]](*)\//$match[1]})
+  reply=(${(M)${(f)"$(zftp ls -lF $dir)"}:#d([^[:space:]]##[[:space:]]##)(#c8)?##\/})
+
+  # If ls -lF doesn't work, try dir ...
+  if ! (($#reply)); then
+    reply=(${(M)${(f)"$(zftp dir $dir)"}:#d([^[:space:]]##[[:space:]]##)(#c8)?##})
+  fi
+  reply=(${reply/(#b)d([^[:space:]]##[[:space:]]##)(#c8)([^\/]##)\/#/$match[2]})
 #  () {
 #    zftp ls -LF $dir >|$1
 #    reply=($(awk '/\/$/ { print substr($1, 1, length($1)-1) }' $1))