diff options
author | Eli Zaretskii <eliz@gnu.org> | 2018-01-20 09:48:22 +0200 |
---|---|---|
committer | Eli Zaretskii <eliz@gnu.org> | 2018-01-20 09:48:22 +0200 |
commit | b603affa1fdd6c85cb5513dcc9606fd0b82567f2 (patch) | |
tree | 6de39613d1682b964143ffd95352703025792945 /lisp/emacs-lisp/bytecomp.el | |
parent | 4fd446e9f65e5531b18d4a0c5e08a6eeabc292d8 (diff) | |
download | emacs-b603affa1fdd6c85cb5513dcc9606fd0b82567f2.tar.gz emacs-b603affa1fdd6c85cb5513dcc9606fd0b82567f2.tar.bz2 emacs-b603affa1fdd6c85cb5513dcc9606fd0b82567f2.zip |
Revert "Fix tempfile creation when byte compiling"
This reverts commit 4fd446e9f65e5531b18d4a0c5e08a6eeabc292d8:
* lisp/emacs-lisp/bytecomp.el (byte-compile-file):
Put tempfile next to the target file, as was the original intent.
Diffstat (limited to 'lisp/emacs-lisp/bytecomp.el')
-rw-r--r-- | lisp/emacs-lisp/bytecomp.el | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el index f6d259ba9da..700a7c16b58 100644 --- a/lisp/emacs-lisp/bytecomp.el +++ b/lisp/emacs-lisp/bytecomp.el @@ -1933,7 +1933,17 @@ 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 - (make-temp-file (expand-file-name target-file))) + (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)))) (default-modes (default-file-modes)) (temp-modes (logand default-modes #o600)) (desired-modes (logand default-modes #o666)) |