summaryrefslogtreecommitdiff
path: root/Functions/Zftp/zfcd
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2000-05-08 10:45:02 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2000-05-08 10:45:02 +0000
commit17d342160ae1c59687b61332bd4dee5e62bd509a (patch)
tree7ca5430438165cd96abb44d1d201819438625f11 /Functions/Zftp/zfcd
parentcfcb3202ef71040a7019609da6cb21de57f16ad6 (diff)
downloadzsh-17d342160ae1c59687b61332bd4dee5e62bd509a.tar.gz
zsh-17d342160ae1c59687b61332bd4dee5e62bd509a.zip
11252: no colon at the end of zftp function contexts
Diffstat (limited to 'Functions/Zftp/zfcd')
-rw-r--r--Functions/Zftp/zfcd13
1 files changed, 8 insertions, 5 deletions
diff --git a/Functions/Zftp/zfcd b/Functions/Zftp/zfcd
index b726d9f55..05b7dc998 100644
--- a/Functions/Zftp/zfcd
+++ b/Functions/Zftp/zfcd
@@ -20,11 +20,12 @@
# work just as long as the directory structures under the home match.
emulate -L zsh
+[[ $curcontext = :zf* ]] || local curcontext=:zfcd
if [[ $1 = /* ]]; then
- zfautocheck -dn
+ zfautocheck -dn || return 1
else
- zfautocheck -d
+ zfautocheck -d || return 1
fi
if [[ $1 = $HOME || $1 = $HOME/* ]]; then
@@ -36,7 +37,7 @@ if (( $# == 0 )); then
set -- '~'
elif [[ $# -eq 1 && $1 = - ]]; then
# Emulate `cd -' behaviour.
- set -- $zflastdir
+ set -- $zfconfig[lastdir_$ZFTP_SESSION]
elif [[ $# -eq 2 ]]; then
# Emulate `cd old new' behaviour.
# We have to find a character not in $1 or $2; ! is a good bet.
@@ -47,6 +48,8 @@ fi
# if we want to keep it.
local lastdir=$ZFTP_PWD
-zftp cd "$@" && zflastdir=$lastdir
-print $zflastsession
+zftp cd "$@" && [[ $lastdir != $ZFTP_PWD ]] &&
+zfconfig[lastdir_$ZFTP_SESSION]=$lastdir
+
+print $zfconfig[lastloc_$ZFTP_SESSION]
# }