]> code.delx.au - gnu-emacs/commitdiff
Don't pass raw directory name to 'error'
authorPaul Eggert <eggert@cs.ucla.edu>
Thu, 4 Jun 2015 00:18:59 +0000 (17:18 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Thu, 4 Jun 2015 00:19:19 +0000 (17:19 -0700)
* lisp/files.el (basic-save-buffer-2): Avoid format error if
a directory name contains a string like "%s".

lisp/files.el

index 6939f2b8fc10b437f3116ab16bd114b8c39126cd..26f9f706c1548253d5473c8e4ddcb7ae4c4b67a0 100644 (file)
@@ -4844,9 +4844,9 @@ Before and after saving the buffer, this function runs
                    (file-exists-p buffer-file-name)
                    (> (file-nlinks buffer-file-name) 1)
                    (or dir-writable
-                       (error (concat (format
-                                       "Directory %s write-protected; " dir)
-                                      "cannot break hardlink when saving")))))
+                       (error (concat "Directory %s write-protected; "
+                                      "cannot break hardlink when saving")
+                              dir))))
          ;; Write temp name, then rename it.
          ;; This requires write access to the containing dir,
          ;; which is why we don't try it if we don't have that access.