diff options
author | Michael Albinus <michael.albinus@gmx.de> | 2008-03-30 18:08:20 +0000 |
---|---|---|
committer | Michael Albinus <michael.albinus@gmx.de> | 2008-03-30 18:08:20 +0000 |
commit | da1975d727df98700b50f9b2d714c6d93d0e117d (patch) | |
tree | 57afd2bcb1990748a0b2b49b248a16a3e4e196d6 /lisp/net | |
parent | 0c61d9814ba4ccce428584959e738c22c572fb5a (diff) | |
download | emacs-da1975d727df98700b50f9b2d714c6d93d0e117d.tar.gz |
* net/tramp.el (tramp-do-copy-or-rename-file): Fix check for
overwriting when NEWNAME is a local file.
Diffstat (limited to 'lisp/net')
-rw-r--r-- | lisp/net/tramp.el | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index ac6f64a45da..b30667fa9fb 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el @@ -2955,11 +2955,10 @@ and `rename'. FILENAME and NEWNAME must be absolute file names." (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 |