aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/net
diff options
context:
space:
mode:
authorMichael Albinus <[email protected]>2005-08-09 21:00:39 +0000
committerMichael Albinus <[email protected]>2005-08-09 21:00:39 +0000
commit8012c83504abeb354f9d3a906975b384593d0499 (patch)
treeeb156c5fd5be0a1a35bb999e9b4e7d8034ff182a /lisp/net
parente8bf834340819430b8115729842b6380ac223d8d (diff)
* lisp/net/ange-ftp.el (ange-ftp-send-cmd): Make it work properly with
uploading files. (ange-ftp-canonize-filename): Handle file names beginning with ~ correctly.
Diffstat (limited to 'lisp/net')
-rw-r--r--lisp/net/ange-ftp.el17
1 files changed, 13 insertions, 4 deletions
diff --git a/lisp/net/ange-ftp.el b/lisp/net/ange-ftp.el
index 59d24e4e59..d4b48323e4 100644
--- a/lisp/net/ange-ftp.el
+++ b/lisp/net/ange-ftp.el
@@ -2328,8 +2328,13 @@ and NOWAIT."
;; We cd and then use `ls' with no directory argument.
;; This works around a misfeature of some versions of netbsd ftpd.
(unless (equal cmd1 ".")
- (setq result (ange-ftp-cd host user (nth 1 cmd) 'noerror)))
- (setq cmd1 cmd3)))
+ (setq result (ange-ftp-cd host user
+ ;; Make sure the target to which
+ ;; `cd' is performed is a directory.
+ (file-name-directory (nth 1 cmd))
+ 'noerror)))
+ ;; Concatenate the switches and the target to be used with `ls'.
+ (setq cmd1 (concat "\"" cmd3 " " cmd1 "\""))))
;; First argument is the remote name
((progn
@@ -3122,8 +3127,12 @@ logged in as user USER and cd'd to directory DIR."
(rest (substring name (match-end 0)))
(dir (ange-ftp-expand-dir host user tilda)))
(if dir
- (setq name (if (string-equal dir "/")
- rest (concat dir rest)))
+ (setq name (cond ((string-equal rest "")
+ dir)
+ ((string-equal dir "/")
+ rest)
+ (t
+ (concat dir rest))))
(error "User \"%s\" is not known"
(substring tilda 1)))))