# HG changeset patch # User Michael Albinus # Date 1206900294 0 # Node ID 45fdb0c49e2fd66e5459123dd23f5efc12fb62da # Parent ca8fb3f3e855d85d660414df407a0f0f8ac27f01 * net/tramp.el (tramp-do-copy-or-rename-file): Fix check for overwriting when NEWNAME is a local file. diff -r ca8fb3f3e855 -r 45fdb0c49e2f lisp/net/tramp.el --- 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