(backup-buffer-copy): Use copy-file instead
authorRichard M. Stallman <rms@gnu.org>
Sat, 30 Apr 2005 20:14:32 +0000 (20:14 +0000)
committerRichard M. Stallman <rms@gnu.org>
Sat, 30 Apr 2005 20:14:32 +0000 (20:14 +0000)
of write-region, and put back the 'excl.

lisp/files.el

index 5d7eff9..a2b74f8 100644 (file)
@@ -2761,14 +2761,12 @@ BACKUPNAME is the backup file name, which is the old file renamed."
                       (condition-case nil
                           (delete-file to-name)
                         (file-error nil))
-                      (write-region "" nil to-name nil 'silent nil 'excl)
+                      (copy-file from-name to-name t t 'excl)
                       nil)
                   (file-already-exists t))
-           ;; the file was somehow created by someone else between
-           ;; `make-temp-name' and `write-region', let's try again.
-           nil)
-;        (copy-file from-name to-name t t 'excl))
-         (copy-file from-name to-name t t))
+           ;; The file was somehow created by someone else between
+           ;; `delete-file' and `copy-file', so let's try again.
+           nil))
       ;; Reset the umask.
       (set-default-file-modes umask)))
   (and modes