[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#30564: call-process always fails for empty exec-path
From: |
Lars Ingebrigtsen |
Subject: |
bug#30564: call-process always fails for empty exec-path |
Date: |
Sat, 14 Apr 2018 21:56:38 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) |
Christopher Wellons <wellons@nullprogram.com> writes:
> The call-process function incorrectly fails for valid absolute paths
> when exec-path is nil:
>
> (let ((exec-path ()))
> (call-process "/bin/ls"))
> ;; error: (file-error "Searching for program"
> ;; "No such file or directory" "/bin/ls")
>
> Adding a single element to exec-path fixes the problem, even if that
> element is nonsense:
>
> (let ((exec-path '(t)))
> (call-process "/bin/ls"))
> ;; => 0
>
> The bug is in the for loop in openp() (lread.c). The only successful
> returns are found inside the loop. An empty list results in no loop
> iterations, which means an absolute path has no chance to return
> successfully.
I've now fixed this by transforming the for loop into a do/while loop.
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- bug#30564: call-process always fails for empty exec-path,
Lars Ingebrigtsen <=