summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2009-09-13 18:24:21 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2009-09-13 18:24:21 +0000
commitd980a79a43e5c44acfd884a248c313cb9dad7269 (patch)
tree813ca06ad6e9039c22f5c0634ec0b2231fa9b0e8
parentdc6ef8c9ae613dc7fa5d98b5e03c9f70b66adbcc (diff)
downloadzsh-d980a79a43e5c44acfd884a248c313cb9dad7269.tar.gz
zsh-d980a79a43e5c44acfd884a248c313cb9dad7269.zip
27270: zfcd_match: remove awk dependence
-rw-r--r--ChangeLog7
-rw-r--r--Functions/Zftp/zfcd_match9
2 files changed, 11 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog
index 1dec512b7..e3e57f669 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2009-09-13 Peter Stephenson <p.w.stephenson@ntlworld.com>
+
+ * Baptiste Daroussin: 27270: Functions/Zftp/zfcd_match: remove
+ awk dependence.
+
2009-09-11 Peter Stephenson <pws@csr.com>
* Baptiste Daroussin: 27268: Functions/MIME/pick-web-browser:
@@ -12155,5 +12160,5 @@
*****************************************************
* This is used by the shell to define $ZSH_PATCHLEVEL
-* $Revision: 1.4775 $
+* $Revision: 1.4776 $
*****************************************************
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' \