changeset 93430:45fdb0c49e2f

* net/tramp.el (tramp-do-copy-or-rename-file): Fix check for overwriting when NEWNAME is a local file.
author Michael Albinus <michael.albinus@gmx.de>
date Sun, 30 Mar 2008 18:04:54 +0000
parents ca8fb3f3e855
children 71ced407e5e0
files lisp/net/tramp.el
diffstat 1 files changed, 4 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/net/tramp.el	Sun Mar 30 18:03:25 2008 +0000
+++ b/lisp/net/tramp.el	Sun Mar 30 18:04:54 2008 +0000
@@ -2955,11 +2955,10 @@
   (let ((t1 (tramp-tramp-file-p filename))
 	(t2 (tramp-tramp-file-p newname)))
 
-    (unless ok-if-already-exists
-      (when (and t2 (file-exists-p newname))
-	(with-parsed-tramp-file-name newname nil
-	  (tramp-error
-	   v 'file-already-exists "File %s already exists" newname))))
+    (when (and (not ok-if-already-exists) (file-exists-p newname))
+      (with-parsed-tramp-file-name (if t1 filename newname) nil
+	(tramp-error
+	 v 'file-already-exists "File %s already exists" newname)))
 
     (prog1
 	(cond