]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix tempfile creation when byte compiling
authorPaul Eggert <eggert@cs.ucla.edu>
Sun, 21 Jan 2018 03:12:05 +0000 (19:12 -0800)
committerPaul Eggert <eggert@cs.ucla.edu>
Sun, 21 Jan 2018 03:18:49 +0000 (19:18 -0800)
This improves on the recent fix for master failing to build
on FreeBSD.  Suggested by Stefan Monnier in:
https://lists.gnu.org/r/emacs-devel/2018-01/msg00600.html
* lisp/emacs-lisp/bytecomp.el (byte-compile-file):
Put tempfile next to the target file, as was the original intent.

lisp/emacs-lisp/bytecomp.el

index 80eb6489c31aa3c3cf365d175520abc4de791c8e..a64c88c4f0d4494f8dc2a1e6d502f72de1ac129c 100644 (file)
@@ -1933,17 +1933,7 @@ The value is non-nil if there were no errors, nil if errors."
                       ;; parallel bootstrap), it does not risk getting a
                       ;; half-finished file.  (Bug#4196)
                       (tempfile
-                        (if (file-name-absolute-p target-file)
-                            (make-temp-file target-file)
-                          ;; If target-file is relative and includes
-                          ;; leading directories, make-temp-file will
-                          ;; assume those leading directories exist
-                          ;; under temporary-file-directory, which might
-                          ;; not be true.  So strip leading directories
-                          ;; from relative file names before calling
-                          ;; make-temp-file.
-                          (make-temp-file
-                           (file-name-nondirectory target-file))))
+                       (make-temp-file (expand-file-name target-file)))
                       (default-modes (default-file-modes))
                       (temp-modes (logand default-modes #o600))
                       (desired-modes (logand default-modes #o666))