]> git.eshelyaron.com Git - emacs.git/commitdiff
* net/tramp-sh.el (tramp-do-copy-or-rename-file-via-buffer): Use a
authorMichael Albinus <michael.albinus@gmx.de>
Mon, 3 Nov 2014 14:29:51 +0000 (15:29 +0100)
committerMichael Albinus <michael.albinus@gmx.de>
Mon, 3 Nov 2014 14:29:51 +0000 (15:29 +0100)
local copy of FILENAME, when it is remote.

Fixes: debbugs:18751
lisp/ChangeLog
lisp/net/tramp-sh.el

index 07231507bae8ca29c78d17b7861e34c7305b8fae..41e1039347cc8a69a04252e16c9ec01769236554 100644 (file)
@@ -1,3 +1,8 @@
+2014-11-03  Michael Albinus  <michael.albinus@gmx.de>
+
+       * net/tramp-sh.el (tramp-do-copy-or-rename-file-via-buffer): Use a
+       local copy of FILENAME, when it is remote.  (Bug#18751)
+
 2014-11-02  Michael Albinus  <michael.albinus@gmx.de>
 
        * net/tramp-adb.el (tramp-adb-handle-process-file): Do not raise
index e120aedfc015c777a64f5a53b25cfcf3a1ab720f..a72a79a779795a1001ca5c8d85fe178dc758b04f 100644 (file)
@@ -2061,11 +2061,15 @@ FILENAME is the source file, NEWNAME the target file.
 KEEP-DATE is non-nil if NEWNAME should have the same timestamp as FILENAME."
   (with-temp-buffer
     ;; We must disable multibyte, because binary data shall not be
-    ;; converted.
+    ;; converted.  `insert-file-contents-literally' does not support
+    ;; file name handlers for GNU Emacs; we must create a local copy
+    ;; therefore.
     (set-buffer-multibyte nil)
     (let ((coding-system-for-read 'binary)
-         (jka-compr-inhibit t))
-      (insert-file-contents-literally filename))
+         (jka-compr-inhibit t)
+         (tmpfile (file-local-copy filename)))
+      (insert-file-contents-literally (or tmpfile filename))
+      (when tmpfile (delete-file tmpfile)))
     ;; We don't want the target file to be compressed, so we let-bind
     ;; `jka-compr-inhibit' to t.
     (let ((coding-system-for-write 'binary)