summaryrefslogtreecommitdiff
path: root/lisp/net/tramp-ftp.el
diff options
context:
space:
mode:
authorMiles Bader <miles@gnu.org>2007-10-11 16:24:58 +0000
committerMiles Bader <miles@gnu.org>2007-10-11 16:24:58 +0000
commitc73bd236f75b742ad4642ec94798987ae6e3e1e8 (patch)
treeef5edc8db557fc1d25a17c379e4ae63a38b3ba5c /lisp/net/tramp-ftp.el
parentecb21060d5c1752d41d7a742be565c59b5fcb855 (diff)
parent58ade22bf16a9ec2ff0aee6c59d8db4d1703e94f (diff)
downloademacs-c73bd236f75b742ad4642ec94798987ae6e3e1e8.tar.gz
Merge from emacs--devo--0
Patches applied: * emacs--devo--0 (patch 866-879) - Merge multi-tty branch - Update from CVS - Merge from emacs--rel--22 Revision: emacs@sv.gnu.org/emacs--unicode--0--patch-257
Diffstat (limited to 'lisp/net/tramp-ftp.el')
-rw-r--r--lisp/net/tramp-ftp.el13
1 files changed, 13 insertions, 0 deletions
diff --git a/lisp/net/tramp-ftp.el b/lisp/net/tramp-ftp.el
index 6fe069636f7..85416d308d3 100644
--- a/lisp/net/tramp-ftp.el
+++ b/lisp/net/tramp-ftp.el
@@ -149,6 +149,19 @@ pass to the OPERATION."
(with-parsed-tramp-file-name (car args) nil
(tramp-set-connection-property v "started" t))
nil))
+ ;; If the second argument of `copy-file' or `rename-file' is a
+ ;; remote file name but via FTP, ange-ftp doesn't check this.
+ ;; We must copy it locally first, because there is no place in
+ ;; ange-ftp for correct handling.
+ ((and (memq operation '(copy-file rename-file))
+ (file-remote-p (cadr args))
+ (not (tramp-ftp-file-name-p (cadr args))))
+ (let* ((filename (car args))
+ (newname (cadr args))
+ (tmpfile (tramp-compat-make-temp-file filename))
+ (args (cddr args)))
+ (apply operation filename tmpfile args)
+ (rename-file tmpfile newname (car args))))
;; Normally, the handlers must be discarded.
(t (let* ((inhibit-file-name-handlers
(list 'tramp-file-name-handler