From 61e68d70da5af5afe943f92cd94a8c96e78348d9 Mon Sep 17 00:00:00 2001 From: Tanaka Akira Date: Sun, 1 Aug 1999 14:48:28 +0000 Subject: zsh-3.1.6 --- Functions/Zftp/zfopen | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'Functions/Zftp/zfopen') diff --git a/Functions/Zftp/zfopen b/Functions/Zftp/zfopen index fa9b4f81d..b264aeaba 100644 --- a/Functions/Zftp/zfopen +++ b/Functions/Zftp/zfopen @@ -7,7 +7,7 @@ emulate -L zsh -local optlist opt once +local optlist opt once dir while [[ $1 = -* ]]; do if [[ $1 = - || $1 = -- ]]; then @@ -31,12 +31,22 @@ done # both .netrc and .ncftp/bookmarks . We could even try saving # the info in their for new hosts, like ncftp does. +if [[ $1 = */* ]]; then + 1=${1##ftp://} + dir=${1#*/} + 1=${1%%/*} +fi + if [[ $once = 1 ]]; then - zftp open $* + zftp open $* || return 1 else # set parameters, but only if there was at least a host (( $# > 0 )) && zfparams $* # now call with no parameters - zftp open + zftp open || return 1 +fi + +if [[ -n $dir ]]; then + zfcd $dir fi # } -- cgit 1.4.1