summaryrefslogtreecommitdiff
path: root/lisp/files.el
diff options
context:
space:
mode:
authorGlenn Morris <rgm@gnu.org>2011-03-12 11:19:47 -0800
committerGlenn Morris <rgm@gnu.org>2011-03-12 11:19:47 -0800
commit09d9db2c4921cb2eb0974892164dd03d6bffdd80 (patch)
tree7165f97f16ea0eaab567db2a45f69d1cdf66bdce /lisp/files.el
parent54ce11a161cd756047fccdfc128dc0527692ea06 (diff)
parent6efb972c00a9ea8ffa84118199aa59c2d3a3b50e (diff)
downloademacs-09d9db2c4921cb2eb0974892164dd03d6bffdd80.tar.gz
Merge from emacs-23; up to 2010-06-03T22:16:02Z!dann@ics.uci.edu
Diffstat (limited to 'lisp/files.el')
-rw-r--r--lisp/files.el10
1 files changed, 8 insertions, 2 deletions
diff --git a/lisp/files.el b/lisp/files.el
index ffc0b33119f..198d5ca87de 100644
--- a/lisp/files.el
+++ b/lisp/files.el
@@ -3895,11 +3895,17 @@ See also `file-name-version-regexp'."
(let ((handler (find-file-name-handler file 'file-ownership-preserved-p)))
(if handler
(funcall handler 'file-ownership-preserved-p file)
- (let ((attributes (file-attributes file)))
+ (let ((attributes (file-attributes file 'integer)))
;; Return t if the file doesn't exist, since it's true that no
;; information would be lost by an (attempted) delete and create.
(or (null attributes)
- (= (nth 2 attributes) (user-uid)))))))
+ (= (nth 2 attributes) (user-uid))
+ ;; Files created on Windows by Administrator (RID=500)
+ ;; have the Administrators group (RID=544) recorded as
+ ;; their owner. Rewriting them will still preserve the
+ ;; owner.
+ (and (eq system-type 'windows-nt)
+ (= (user-uid) 500) (= (nth 2 attributes) 544)))))))
(defun file-name-sans-extension (filename)
"Return FILENAME sans final \"extension\".