Re: Cygwin's execlp() does not work with an empty $PATH element

2022-06-27 Thread Takashi Yano
On Mon, 27 Jun 2022 20:16:36 +0900 Takashi Yano wrote: > How about the following patch? This is better a bit. diff --git a/winsup/cygwin/spawn.cc b/winsup/cygwin/spawn.cc index e0f1247e1..292cd5a42 100644 --- a/winsup/cygwin/spawn.cc +++ b/winsup/cygwin/spawn.cc @@ -95,6 +95,7 @@ find_exec (const

Re: Cygwin's execlp() does not work with an empty $PATH element

2022-06-27 Thread Takashi Yano
On Sun, 26 Jun 2022 15:09:34 + "Lavrentiev, Anton \(NIH/NLM/NCBI\) \[C\] wrote: > An empty PATH element (":xxx" or "xxx::xxx" or "xxx:") is to be considered as > the current directory (from the very first days of Unix). > > However, Cygwin does not seem to obey the rule. > > Consider the fol

RE: Cygwin's execlp() does not work with an empty $PATH element

2022-06-26 Thread Lavrentiev, Anton (NIH/NLM/NCBI) [C] via Cygwin
There's another discrepancy for execlp() on Cygwin. In the absence of the PATH environment, it should consider the current directory first, then look up somewhere else. And it does so on Linux! Not on Cygwin, though. Please take a look below: Linux: $ ./hello exec: No such file or directory