aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Eggert2015-06-03 17:18:59 -0700
committerPaul Eggert2015-06-03 17:19:19 -0700
commitadc7d9e89c8fc3bda483b2b543d7774e8fde1bac (patch)
treeec0745bc86c574a4cbff06773ef2c9680863dda8
parent6d020ecd8951244296ebefc04d15eb10781bb846 (diff)
downloademacs-adc7d9e89c8fc3bda483b2b543d7774e8fde1bac.tar.gz
emacs-adc7d9e89c8fc3bda483b2b543d7774e8fde1bac.zip
Don't pass raw directory name to 'error'
* lisp/files.el (basic-save-buffer-2): Avoid format error if a directory name contains a string like "%s".
-rw-r--r--lisp/files.el6
1 files changed, 3 insertions, 3 deletions
diff --git a/lisp/files.el b/lisp/files.el
index 6939f2b8fc1..26f9f706c15 100644
--- a/lisp/files.el
+++ b/lisp/files.el
@@ -4844,9 +4844,9 @@ Before and after saving the buffer, this function runs
4844 (file-exists-p buffer-file-name) 4844 (file-exists-p buffer-file-name)
4845 (> (file-nlinks buffer-file-name) 1) 4845 (> (file-nlinks buffer-file-name) 1)
4846 (or dir-writable 4846 (or dir-writable
4847 (error (concat (format 4847 (error (concat "Directory %s write-protected; "
4848 "Directory %s write-protected; " dir) 4848 "cannot break hardlink when saving")
4849 "cannot break hardlink when saving"))))) 4849 dir))))
4850 ;; Write temp name, then rename it. 4850 ;; Write temp name, then rename it.
4851 ;; This requires write access to the containing dir, 4851 ;; This requires write access to the containing dir,
4852 ;; which is why we don't try it if we don't have that access. 4852 ;; which is why we don't try it if we don't have that access.