about summary refs log tree commit diff
path: root/Functions/Zftp/zfparams
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/zfparams
parentcfcb3202ef71040a7019609da6cb21de57f16ad6 (diff)
downloadzsh-17d342160ae1c59687b61332bd4dee5e62bd509a.tar.gz
zsh-17d342160ae1c59687b61332bd4dee5e62bd509a.tar.xz
zsh-17d342160ae1c59687b61332bd4dee5e62bd509a.zip
11252: no colon at the end of zftp function contexts
Diffstat (limited to 'Functions/Zftp/zfparams')
-rw-r--r--Functions/Zftp/zfparams23
1 files changed, 19 insertions, 4 deletions
diff --git a/Functions/Zftp/zfparams b/Functions/Zftp/zfparams
index 5c5262c52..59fea0ed4 100644
--- a/Functions/Zftp/zfparams
+++ b/Functions/Zftp/zfparams
@@ -1,12 +1,27 @@
 # function zfparams {
 
 emulate -L zsh
+[[ $curcontext = :zf* ]] || local curcontext=:zfparams
 
-# Set to prompt for any user or password if not given.
-# Don't worry about accounts here.
-if (( $# > 0 )); then
+if [[ $# -eq 1 && $1 = - ]]; then
+  # Delete existing parameter set.
+  local sess=$ZFTP_SESSION key
+  key=${zfconfig[fcache_$sess]}
+  [[ -n $key ]] && unset $key
+  for key in fcache lastloc lastdir curdir otherdir otherargs lastuser; do
+    unset "zfconfig[${key}_${sess}]"
+  done
+elif (( $# > 0 )); then
+  # Set to prompt for any user or password if not given.
+  # Don't worry about accounts here.
   (( $# < 2 )) && 2='?'
-  (( $# < 3 )) && 3='?'
+  if (( $# < 3 )); then
+    if [[ $2 = '?'* ]]; then
+      3="?Password on ${1}: "
+    else
+      3="?Password for ${2##\\?} on ${1}: "
+    fi
+  fi
 fi
 zftp params $*
 # }