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

PATCH: zftp directory cache



There's an ancient bug I've never got around to fixing that zfdir
doesn't recognise directory changes and uses the old directory.

Index: Functions/Zftp/zfcd
===================================================================
RCS file: /cvsroot/zsh/zsh/Functions/Zftp/zfcd,v
retrieving revision 1.2
diff -u -r1.2 zfcd
--- Functions/Zftp/zfcd	8 May 2000 10:45:02 -0000	1.2
+++ Functions/Zftp/zfcd	6 Aug 2004 13:51:18 -0000
@@ -48,8 +48,11 @@
 # if we want to keep it.
 local lastdir=$ZFTP_PWD
 
-zftp cd "$@" && [[ $lastdir != $ZFTP_PWD ]] &&
-zfconfig[lastdir_$ZFTP_SESSION]=$lastdir
+if zftp cd "$@" && [[ $lastdir != $ZFTP_PWD ]]; then
+  # Invalidate current directory listing.
+  rm -f zfconfig[curdir_$ZFTP_SESSION]
+  zfconfig[lastdir_$ZFTP_SESSION]=$lastdir
+fi
 
 print $zfconfig[lastloc_$ZFTP_SESSION]
 # }

-- 
Peter Stephenson <pws@xxxxxxx>                  Software Engineer
CSR Ltd., Science Park, Milton Road,
Cambridge, CB4 0WH, UK                          Tel: +44 (0)1223 692070


**********************************************************************
The information transmitted is intended only for the person or
entity to which it is addressed and may contain confidential 
and/or privileged material. 
Any review, retransmission, dissemination or other use of, or
taking of any action in reliance upon, this information by 
persons or entities other than the intended recipient is 
prohibited. 
If you received this in error, please contact the sender and 
delete the material from any computer.
**********************************************************************



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