From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Lars Ingebrigtsen Newsgroups: gmane.emacs.bugs Subject: bug#30564: call-process always fails for empty exec-path Date: Sat, 14 Apr 2018 21:56:38 +0200 Message-ID: <87r2nh1s09.fsf@mouse.gnus.org> References: <20180221020736.GE12719@nullprogram.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1523735709 18586 195.159.176.226 (14 Apr 2018 19:55:09 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 14 Apr 2018 19:55:09 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: 30564@debbugs.gnu.org To: Christopher Wellons Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Apr 14 21:55:05 2018 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1f7RGK-0004dH-LL for geb-bug-gnu-emacs@m.gmane.org; Sat, 14 Apr 2018 21:55:04 +0200 Original-Received: from localhost ([::1]:60866 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f7RIP-0007Mi-7a for geb-bug-gnu-emacs@m.gmane.org; Sat, 14 Apr 2018 15:57:13 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:38955) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f7RII-0007Li-EY for bug-gnu-emacs@gnu.org; Sat, 14 Apr 2018 15:57:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f7RIE-00021x-JD for bug-gnu-emacs@gnu.org; Sat, 14 Apr 2018 15:57:06 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:44857) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1f7RIE-00021p-FJ for bug-gnu-emacs@gnu.org; Sat, 14 Apr 2018 15:57:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1f7RID-00073i-Vf for bug-gnu-emacs@gnu.org; Sat, 14 Apr 2018 15:57:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Lars Ingebrigtsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 14 Apr 2018 19:57:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 30564 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 30564-submit@debbugs.gnu.org id=B30564.152373580927110 (code B ref 30564); Sat, 14 Apr 2018 19:57:01 +0000 Original-Received: (at 30564) by debbugs.gnu.org; 14 Apr 2018 19:56:49 +0000 Original-Received: from localhost ([127.0.0.1]:52752 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1f7RI1-00073B-Ls for submit@debbugs.gnu.org; Sat, 14 Apr 2018 15:56:49 -0400 Original-Received: from hermes.netfonds.no ([80.91.224.195]:56664) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1f7RHz-00072x-TD for 30564@debbugs.gnu.org; Sat, 14 Apr 2018 15:56:48 -0400 Original-Received: from 46.67.12.60.tmi.telenormobil.no ([46.67.12.60] helo=corrigan) by hermes.netfonds.no with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1f7RHw-0006MA-JP; Sat, 14 Apr 2018 21:56:46 +0200 Original-Received: from larsi by corrigan with local (Exim 4.89) (envelope-from ) id 1f7RHq-0008B4-Hm; Sat, 14 Apr 2018 21:56:38 +0200 In-Reply-To: <20180221020736.GE12719@nullprogram.com> (Christopher Wellons's message of "Tue, 20 Feb 2018 21:07:36 -0500") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:145363 Archived-At: Christopher Wellons 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