diff options
author | Tanaka Akira <akr@users.sourceforge.net> | 1999-07-28 15:31:20 +0000 |
---|---|---|
committer | Tanaka Akira <akr@users.sourceforge.net> | 1999-07-28 15:31:20 +0000 |
commit | 1963f77d2807f9437e3183b14af4b35d74e535d8 (patch) | |
tree | 94599b76d8caf899660b1fd2781df0e5ef402af3 /Functions/Zftp/zftp_chpwd | |
parent | 82e024546926e35f1e7b4047757ec00fb7cf64cf (diff) | |
download | zsh-1963f77d2807f9437e3183b14af4b35d74e535d8.tar.gz zsh-1963f77d2807f9437e3183b14af4b35d74e535d8.tar.xz zsh-1963f77d2807f9437e3183b14af4b35d74e535d8.zip |
zsh-workers:7305
Diffstat (limited to 'Functions/Zftp/zftp_chpwd')
-rw-r--r-- | Functions/Zftp/zftp_chpwd | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/Functions/Zftp/zftp_chpwd b/Functions/Zftp/zftp_chpwd index 0df199cfb..0b5bbd7d5 100644 --- a/Functions/Zftp/zftp_chpwd +++ b/Functions/Zftp/zftp_chpwd @@ -1,13 +1,16 @@ # function zftp_chpwd { # You may want to alter chpwd to call this when $ZFTP_USER is set. -# Cancel the filename cache for the current directory. -zftp_fcache=() -# ...and also empty the stored directory listing cache. -# As this function is called when we close the connection, this -# is the only place we need to do these two things. -[[ -n $zfcurdir && -f $zfcurdir ]] && rm -f $zfcurdir -zfotherargs= +# If the directory really changed... +if [[ $ZFTP_PWD != $zflastdir ]]; then + # Cancel the filename cache for the current directory. + zftp_fcache=() + # ...and also empty the stored directory listing cache. + # As this function is called when we close the connection, this + # is the only place we need to do these two things. + [[ -n $zfcurdir && -f $zfcurdir ]] && rm -f $zfcurdir + zfotherargs= +fi if [[ -z $ZFTP_USER ]]; then # last call, after an FTP logout @@ -24,6 +27,7 @@ if [[ -z $ZFTP_USER ]]; then else [[ -n $ZFTP_PWD ]] && zflastdir=$ZFTP_PWD zflastsession="$ZFTP_HOST:$ZFTP_PWD" + zflastuser="$ZFTP_USER" local args if [[ -t 1 && -t 2 ]]; then local str=$zflastsession |