changeset 2108:baec460e28c7

* files.el (basic-save-buffer): If file-precious-flag is set, and we write the buffer to a temp file and then rename it, don't neglect to set the new file's modes properly.
author Jim Blandy <jimb@redhat.com>
date Thu, 11 Mar 1993 07:04:44 +0000
parents 1c718ee07ac9
children 73485780a8f9
files lisp/files.el
diffstat 1 files changed, 4 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/files.el	Thu Mar 11 07:03:57 1993 +0000
+++ b/lisp/files.el	Thu Mar 11 07:04:44 1993 +0000
@@ -1279,6 +1279,10 @@
 			   ;; If writing the temp file fails,
 			   ;; delete the temp file.
 			   (or succeed (delete-file tempname)))
+			 ;; Since we have created an entirely new file
+			 ;; and renamed it, make sure it gets the
+			 ;; right permission bits set.
+			 (setq setmodes (file-modes buffer-file-name))
 			 ;; We succeeded in writing the temp file,
 			 ;; so rename it.
 			 (rename-file tempname buffer-file-name t))