From: Lars Ingebrigtsen <larsi@gnus.org>
To: Christopher Wellons <wellons@nullprogram.com>
Cc: 30564@debbugs.gnu.org
Subject: bug#30564: call-process always fails for empty exec-path
Date: Sat, 14 Apr 2018 21:56:38 +0200 [thread overview]
Message-ID: <87r2nh1s09.fsf@mouse.gnus.org> (raw)
In-Reply-To: <20180221020736.GE12719@nullprogram.com> (Christopher Wellons's message of "Tue, 20 Feb 2018 21:07:36 -0500")
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 parent reply other threads:[~2018-04-14 19:56 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-02-21 2:07 bug#30564: call-process always fails for empty exec-path Christopher Wellons
2018-04-14 19:56 ` Lars Ingebrigtsen [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87r2nh1s09.fsf@mouse.gnus.org \
--to=larsi@gnus.org \
--cc=30564@debbugs.gnu.org \
--cc=wellons@nullprogram.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.