Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

PATCH: zfcd_match erratic on some awks



Seems that behavior for an index of 0 is undefined.  While this
works out fine for gawk and Solaris awk, mawk has different ideas
of what to do.  This should make everybody happy.

Index: Functions/Zftp/zfcd_match
===================================================================
RCS file: /cvsroot/zsh/zsh/Functions/Zftp/zfcd_match,v
retrieving revision 1.2
diff -u -r1.2 zfcd_match
--- Functions/Zftp/zfcd_match	2000/04/01 20:49:47	1.2
+++ Functions/Zftp/zfcd_match	2000/04/04 17:15:17
@@ -26,7 +26,7 @@
   # 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, 0, length($1)-1) }' $tmpf))
+  reply=($(awk '/\/$/ { print substr($1, 1, length($1)-1) }' $tmpf))
   rm -f $tmpf
   [[ -n $dir && $dir != */ ]] && dir="$dir/"
   if [[ -n $WIDGET ]]; then



Messages sorted by: Reverse Date, Date, Thread, Author