summaryrefslogtreecommitdiff
path: root/Functions/Zftp/zfpcp
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/zfpcp
parentcfcb3202ef71040a7019609da6cb21de57f16ad6 (diff)
downloadzsh-17d342160ae1c59687b61332bd4dee5e62bd509a.tar.gz
zsh-17d342160ae1c59687b61332bd4dee5e62bd509a.zip
11252: no colon at the end of zftp function contexts
Diffstat (limited to 'Functions/Zftp/zfpcp')
-rw-r--r--Functions/Zftp/zfpcp6
1 files changed, 5 insertions, 1 deletions
diff --git a/Functions/Zftp/zfpcp b/Functions/Zftp/zfpcp
index ddd570e59..e74ee34f8 100644
--- a/Functions/Zftp/zfpcp
+++ b/Functions/Zftp/zfpcp
@@ -14,10 +14,11 @@
emulate -L zsh
+[[ $curcontext = :zf* ]] || local curcontext=:zfpcp
local rem loc
integer stat do_close
-zfautocheck
+zfautocheck || return 1
if [[ $# -gt 2 || $2 = (.|..) || $2 = */ ]]; then
local dir=$argv[-1]
@@ -32,6 +33,9 @@ if [[ $# -gt 2 || $2 = (.|..) || $2 = */ ]]; then
zftp put $rem <$loc || stat=1
done
else
+ if [[ $2 = $HOME || $2 = $HOME/* ]]; then
+ 2="~${2#$HOME}"
+ fi
zftp put $2 <$1
stat=$?
if [[ stat -ne 0 && $ZFTP_CODE = 553 && $ZFTP_REPLY = *'Is a directory'* ]]