]> code.delx.au - gnu-emacs/commitdiff
Fix an error in Tramp for rsync
authorMichael Albinus <michael.albinus@gmx.de>
Thu, 7 Jul 2016 16:50:24 +0000 (18:50 +0200)
committerMichael Albinus <michael.albinus@gmx.de>
Thu, 7 Jul 2016 16:50:24 +0000 (18:50 +0200)
* lisp/net/tramp-sh.el (tramp-do-copy-or-rename-file-out-of-band):
Make it work for "rsync".
(tramp-make-copy-program-file-name): Apply `directory-file-name'.

lisp/net/tramp-sh.el

index 606572b9c7d92322a15f3496a31622dcb4350527..430c1c1d877800fbaf9969b784232d904d246aee 100644 (file)
@@ -2375,19 +2375,17 @@ The method used must be an out-of-band method."
        (aset v 3 localname)
 
        ;; Check which ones of source and target are Tramp files.
-       (setq source (if t1
-                        (tramp-make-copy-program-file-name v)
-                      (shell-quote-argument filename))
-             target (funcall
+       (setq source (funcall
                      (if (and (file-directory-p filename)
-                              (string-equal
-                               (file-name-nondirectory filename)
-                               (file-name-nondirectory newname)))
-                         'file-name-directory
+                              (not (file-exists-p newname)))
+                         'file-name-as-directory
                        'identity)
-                     (if t2
+                     (if t1
                          (tramp-make-copy-program-file-name v)
-                       (shell-quote-argument newname))))
+                       (shell-quote-argument filename)))
+             target (if t2
+                        (tramp-make-copy-program-file-name v)
+                      (shell-quote-argument newname)))
 
        ;; Check for host and port number.  We cannot use
        ;; `tramp-file-name-port', because this returns also
@@ -5102,7 +5100,7 @@ Return ATTR."
   (let ((method (tramp-file-name-method vec))
        (user (tramp-file-name-user vec))
        (host (tramp-file-name-real-host vec))
-       (localname (tramp-file-name-localname vec)))
+       (localname (directory-file-name (tramp-file-name-localname vec))))
     (when (string-match tramp-ipv6-regexp host)
       (setq host (format "[%s]" host)))
     (unless (string-match "ftp$" method)