From 8273986b5aaa1c6b48e4b350cc2fbe2a69f80056 Mon Sep 17 00:00:00 2001 From: Michael Albinus Date: Mon, 17 Mar 2014 10:28:47 +0100 Subject: [PATCH] * net/tramp.el (tramp-action-out-of-band): Read pending output. (tramp-call-process): Trace also DESTINATION. * net/tramp-sh.el (tramp-do-copy-or-rename-file-out-of-band): Quote file names when they are local. Remove superfluous trace. --- lisp/ChangeLog | 8 ++++++++ lisp/net/tramp-sh.el | 9 ++++++--- lisp/net/tramp.el | 6 ++++-- 3 files changed, 18 insertions(+), 5 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index b3f9a9073f6..2946ac5e0ac 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,11 @@ +2014-03-17 Michael Albinus + + * net/tramp.el (tramp-action-out-of-band): Read pending output. + (tramp-call-process): Trace also DESTINATION. + + * net/tramp-sh.el (tramp-do-copy-or-rename-file-out-of-band): + Quote file names when they are local. Remove superfluous trace. + 2014-03-17 Dmitry Gutov * newcomment.el (comment-beginning): If `comment-start-skip' diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el index ee37373a0fa..245d4f1ae8b 100644 --- a/lisp/net/tramp-sh.el +++ b/lisp/net/tramp-sh.el @@ -2246,7 +2246,9 @@ 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) filename) + (setq source (if t1 + (tramp-make-copy-program-file-name v) + (shell-quote-argument filename)) target (funcall (if (and (file-directory-p filename) (string-equal @@ -2254,7 +2256,9 @@ The method used must be an out-of-band method." (file-name-nondirectory newname))) 'file-name-directory 'identity) - (if t2 (tramp-make-copy-program-file-name v) newname))) + (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 @@ -2376,7 +2380,6 @@ The method used must be an out-of-band method." (buffer-substring (point-min) (point-at-eol)))))) ;; Reset the transfer process properties. - (tramp-message orig-vec 6 "\n%s" (buffer-string)) (tramp-set-connection-property v "process-name" nil) (tramp-set-connection-property v "process-buffer" nil))) diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index face017946d..5ff68e0f0f9 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el @@ -3468,6 +3468,8 @@ The terminal type can be configured with `tramp-terminal-type'." (defun tramp-action-out-of-band (proc vec) "Check, whether an out-of-band copy has finished." + ;; There might be pending output for the exit status. + (tramp-accept-process-output proc 0.1) (cond ((and (memq (process-status proc) '(stop exit)) (zerop (process-exit-status proc))) (tramp-message vec 3 "Process has finished.") @@ -4092,7 +4094,7 @@ Lisp error raised when PROGRAM is nil is trapped also, returning 1. Furthermore, traces are written with verbosity of 6." (tramp-message (vector tramp-current-method tramp-current-user tramp-current-host nil nil) - 6 "`%s %s' %s" program (mapconcat 'identity args " ") infile) + 6 "`%s %s' %s %s" program (mapconcat 'identity args " ") infile destination) (if (executable-find program) (apply 'call-process program infile destination display args) 1)) @@ -4229,7 +4231,7 @@ T1 and T2 are time values (as returned by `current-time' for example)." ;; This function should produce a string which is grokked by a Unix ;; shell, even if the Emacs is running on Windows. Since this is the ;; kludges section, we bind `system-type' in such a way that -;; `shell-quote-arguments' behaves as if on Unix. +;; `shell-quote-argument' behaves as if on Unix. ;; ;; Thanks to Mario DeWeerd for the hint that it is sufficient for this ;; function to work with Bourne-like shells. -- 2.39.2