From e89eda2635dc338b5639c0bac9452189ecf9b730 Mon Sep 17 00:00:00 2001 From: Tanaka Akira Date: Wed, 15 Sep 1999 15:59:12 +0000 Subject: zsh-workers/7855 --- Functions/Zftp/zfopen | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'Functions/Zftp') diff --git a/Functions/Zftp/zfopen b/Functions/Zftp/zfopen index 32b450411..7c7c945d4 100644 --- a/Functions/Zftp/zfopen +++ b/Functions/Zftp/zfopen @@ -7,7 +7,7 @@ emulate -L zsh -local opt dir opt_1 +local opt dir opt_1 setparams while getopts :1 opt; do [[ $opt = "?" ]] && print "zfopen: bad option: -$OPTARG" >&2 && return 1 @@ -35,9 +35,13 @@ if [[ $opt_1 = 1 ]]; then fi else # set parameters, but only if there was at least a host - (( $# > 0 )) && zfparams $* + (( $# > 0 )) && zfparams $* && setparams=1 # now call with no parameters - zftp open || return 1 + if ! zftp open; then + [[ -n $ZFTP_HOST ]] && zftp close + [[ -n $setparams ]] && zfparams - + return 1 + fi fi if [[ -n $dir ]]; then -- cgit 1.4.1