[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master cd35c1c 1/2: Allow using /dev/stdin as a --script parameter again
From: |
Lars Ingebrigtsen |
Subject: |
master cd35c1c 1/2: Allow using /dev/stdin as a --script parameter again |
Date: |
Thu, 11 Nov 2021 22:27:22 -0500 (EST) |
branch: master
commit cd35c1c7cfc4823caf497af8eb0e840b4324dc97
Author: Lars Ingebrigtsen <larsi@gnus.org>
Commit: Lars Ingebrigtsen <larsi@gnus.org>
Allow using /dev/stdin as a --script parameter again
* lisp/startup.el (command-line-1): Fix breakage with
(file-truename "/dev/stdin") => "/proc/227795/fd/pipe:[1381505]"
when using /dev/stdin as a --script parameter.
---
lisp/startup.el | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/lisp/startup.el b/lisp/startup.el
index 505d7b8..a911aed 100644
--- a/lisp/startup.el
+++ b/lisp/startup.el
@@ -2526,7 +2526,15 @@ nil default-directory" name)
(let* ((file (command-line-normalize-file-name
(or argval (pop command-line-args-left))))
;; Take file from default dir.
- (file-ex (file-truename (expand-file-name file))))
+ (file-ex (expand-file-name file))
+ (truename (file-truename file-ex)))
+ ;; We want to use the truename here if we can,
+ ;; because that makes `eval-after-load' work
+ ;; more reliably. But If the file is, for
+ ;; instance, /dev/stdin, the truename doesn't
+ ;; actually exist on some systems.
+ (when (file-exists-p truename)
+ (setq file-ex truename))
(load file-ex nil t t)))
((equal argi "-insert")