diff options
author | Eli Zaretskii <eliz@gnu.org> | 2005-03-19 13:30:10 +0000 |
---|---|---|
committer | Eli Zaretskii <eliz@gnu.org> | 2005-03-19 13:30:10 +0000 |
commit | 79d2d2796a1f902a5f14edec9b300c053923c230 (patch) | |
tree | bdd13e7bae84c13a852e3534536fdfe85d617cfe /lisp/files.el | |
parent | f3b7338cc32de5be34c3564cf250ed242354be35 (diff) | |
download | emacs-79d2d2796a1f902a5f14edec9b300c053923c230.tar.gz |
(backup-buffer): If the file's directory is not writable,
use copy instead of move to backup the file.
Diffstat (limited to 'lisp/files.el')
-rw-r--r-- | lisp/files.el | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/lisp/files.el b/lisp/files.el index ebd4d469f5c..68a1d52a2df 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -2687,6 +2687,7 @@ BACKUPNAME is the backup file name, which is the old file renamed." backup-by-copying ;; Don't rename a suid or sgid file. (and modes (< 0 (logand modes #o6000))) + (not (file-writable-p (file-name-directory real-file-name))) (and backup-by-copying-when-linked (> (file-nlinks real-file-name) 1)) (and (or backup-by-copying-when-mismatch |