tramp-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 1/1] * tramp.el (tramp-do-copy-or-rename-file-directly): Avoid se


From: Julian Scheid
Subject: [PATCH 1/1] * tramp.el (tramp-do-copy-or-rename-file-directly): Avoid separate tramp-send-command-and-check call.
Date: Sat, 15 Aug 2009 18:02:44 +1200

---
 lisp/ChangeLog |    5 +++++
 lisp/tramp.el  |   16 +++++++++-------
 2 files changed, 14 insertions(+), 7 deletions(-)

diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index d52781c..de996e7 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,8 @@
+2009-08-15  Julian Scheid  <address@hidden>
+
+       * tramp.el (tramp-do-copy-or-rename-file-directly): Avoid separate
+       tramp-send-command-and-check call.
+
 2009-08-14  Michael Albinus  <address@hidden>
 
        * tramp.el (tramp-message-show-message): New defvar.
diff --git a/lisp/tramp.el b/lisp/tramp.el
index 1ecae2c..112155d 100644
--- a/lisp/tramp.el
+++ b/lisp/tramp.el
@@ -3348,16 +3348,18 @@ the uid and gid from FILENAME."
              (if t1 (tramp-handle-file-remote-p filename 'localname) filename))
             (localname2
              (if t2 (tramp-handle-file-remote-p newname 'localname) newname))
-            (prefix (file-remote-p (if t1 filename newname))))
+            (prefix (file-remote-p (if t1 filename newname)))
+             cmd-result)
 
        (cond
         ;; Both files are on a remote host, with same user.
         ((and t1 t2)
-         (tramp-send-command
-          v
-          (format "%s %s %s" cmd
-                  (tramp-shell-quote-argument localname1)
-                  (tramp-shell-quote-argument localname2)))
+          (setq cmd-result
+                (tramp-send-command-and-check
+                 v
+                 (format "%s %s %s" cmd
+                         (tramp-shell-quote-argument localname1)
+                         (tramp-shell-quote-argument localname2))))
          (with-current-buffer (tramp-get-buffer v)
            (goto-char (point-min))
            (unless
@@ -3366,7 +3368,7 @@ the uid and gid from FILENAME."
                      ;; Mask cp -f error.
                      (re-search-forward
                       tramp-operation-not-permitted-regexp nil t))
-                (zerop (tramp-send-command-and-check v nil)))
+                (zerop cmd-result))
              (tramp-error-with-buffer
               nil v 'file-error
               "Copying directly failed, see buffer `%s' for details."
-- 
1.6.4





reply via email to

[Prev in Thread] Current Thread [Next in Thread]