about summary refs log tree commit diff
path: root/Functions/Zftp
diff options
context:
space:
mode:
authorTanaka Akira <akr@users.sourceforge.net>1999-07-19 14:26:14 +0000
committerTanaka Akira <akr@users.sourceforge.net>1999-07-19 14:26:14 +0000
commitd6d4a3abfc84f0940e663cd69537789a039a7056 (patch)
tree5f5f40ae248c17c34fccbcadef85dddd4136b781 /Functions/Zftp
parent1f6786ef7ae24ff858f52c6d4ac2bc23d529c0c1 (diff)
downloadzsh-d6d4a3abfc84f0940e663cd69537789a039a7056.tar.gz
zsh-d6d4a3abfc84f0940e663cd69537789a039a7056.tar.xz
zsh-d6d4a3abfc84f0940e663cd69537789a039a7056.zip
zsh-3.1.6-test-2 zsh-3.1.6-test-2
Diffstat (limited to 'Functions/Zftp')
-rw-r--r--Functions/Zftp/zfgoto5
-rw-r--r--Functions/Zftp/zfinit2
2 files changed, 5 insertions, 2 deletions
diff --git a/Functions/Zftp/zfgoto b/Functions/Zftp/zfgoto
index 8d6f00a3a..bd1cdbfe5 100644
--- a/Functions/Zftp/zfgoto
+++ b/Functions/Zftp/zfgoto
@@ -67,7 +67,10 @@ line=${line#*@}
 host=${line%%:*}
 dir=${line#*:}
 
-if [[ $user = ftp || $user = anonymous ]]; then
+if [[ $ZFTP_USER = $user && $ZFTP_HOST = $host ]]; then
+  # We're already there, just change directory
+  zfcd ${dir:-~}
+elif [[ $user = ftp || $user = anonymous ]]; then
   # Anonymous ftp, so we don't need password etc.
   zfanon $host && [[ -n $dir ]] && zfcd $dir
 elif [[ $zflastsession = ${host}:* && $user = $zflastuser ]]; then
diff --git a/Functions/Zftp/zfinit b/Functions/Zftp/zfinit
index fbe6c5979..2a5fd9b47 100644
--- a/Functions/Zftp/zfinit
+++ b/Functions/Zftp/zfinit
@@ -1,6 +1,6 @@
 emulate -L zsh
 
-[[ $1 = -n ]] || zmodload -ia zftp
+[[ $1 = -n ]] || zmodload -e zftp || zmodload -ia zftp
 
 alias zfcd='noglob zfcd'
 alias zfget='noglob zfget'