GNU bug report logs - #30564
call-process always fails for empty exec-path

Previous Next

Package: emacs;

Reported by: Christopher Wellons <wellons <at> nullprogram.com>

Date: Wed, 21 Feb 2018 02:08:02 UTC

Severity: minor

Tags: fixed

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Christopher Wellons <wellons <at> nullprogram.com>
Cc: 30564 <at> debbugs.gnu.org
Subject: bug#30564: call-process always fails for empty exec-path
Date: Sat, 14 Apr 2018 21:56:38 +0200
Christopher Wellons <wellons <at> 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




This bug report was last modified 7 years and 39 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.