From 35fd0881e61b873ae8c7e4dd9b723d5dd2b578c9 Mon Sep 17 00:00:00 2001 From: Nix Date: Thu, 19 May 2011 17:51:46 -0700 Subject: [PATCH] Small break-hardlink-on-save fix. * files.el (basic-save-buffer-2): Fix handling of break-hardlink-on-save with non-existent files. --- lisp/ChangeLog | 5 +++++ lisp/files.el | 1 + 2 files changed, 6 insertions(+) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 00ca21c903b..d1ec662bac8 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2011-05-20 Nix + + * files.el (basic-save-buffer-2): + Fix handling of break-hardlink-on-save with non-existent files. + 2011-05-19 Deniz Dogan * net/rcirc.el (rcirc-mode): Initialize rcirc-urls to nil. diff --git a/lisp/files.el b/lisp/files.el index 336a0a436f9..200b9b1d303 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -4517,6 +4517,7 @@ Before and after saving the buffer, this function runs (dir-writable (file-writable-p dir))) (if (or (and file-precious-flag dir-writable) (and break-hardlink-on-save + (file-exists-p buffer-file-name) (> (file-nlinks buffer-file-name) 1) (or dir-writable (error (concat (format -- 2.39.2