Hi Paul,
> note that
> on Windows, which is the only place this matters, so far, IIRC it is
> illegal to use "prog.exe.exe" so if an extension is already provided
> the system won't search again
Indeed, the native Windows execlp() function behaves like this:
- If the caller specifies "prog.exe
On Mon, 2019-09-09 at 20:54 +0200, Bruno Haible wrote:
> -extern const char *find_in_given_path (const char *progname, const char
> *path);
> + - Otherwise, it returns NULL.
> + If OPTIMIZE_FOR_EXEC is true, the function saves some work, under the
> + assumption that the resulting pathname w
Paul Smith wrote:
> Having PATH= be equivalent to PATH=., and even
> moreso "unset PATH" be equivalent to PATH=., is quite odd IMO.
It is just as odd as the fact that
PATH=:/bin is equivalent to PATH=.:/bin
and
PATH=/bin: is equivalent to PATH=/bin:.
> > > My personal opinion is that it's not
On Sun, 2019-09-08 at 19:48 +0200, Bruno Haible wrote:
> > My suggestion was that BOTH these functions should not assume the CWD
> > if PATH is empty or missing, not that they should behave differently.
>
> OK. But what, do you suggest, should the functions do when confronted to
> an empty path? W
Hi Paul,
> > > I find that VERY odd, and possibly a security risk. According to
> > > POSIX, the behavior if PATH is not present or is empty is
> > > implementation-defined and my preference/expectation would be to behave
> > > as if the program is not found. However, that's a different
> > > di
On Sun, 2019-09-08 at 16:59 +0200, Bruno Haible wrote:
> Hi Paul,
>
> > > > prog = find_in_path_str ("myprog", lookup_path ());
> > > >
> > > > and if lookup_path() returns NULL it defaults to the environment
> > > > PATH,
> > >
> > > I don't think NULL should be interpreted as "look in the
Hi Paul,
Here's the implementation I'm committing.
I feel that merging the two functions in a single file would add more
contortions than benefit.
2019-09-08 Bruno Haible
findprog-in: New module.
Suggested by Paul Smith .
* lib/findprog.h (find_in_given_path): New de
Hi Paul,
> > > prog = find_in_path_str ("myprog", lookup_path ());
> > >
> > > and if lookup_path() returns NULL it defaults to the environment
> > > PATH,
> >
> > I don't think NULL should be interpreted as "look in the default
> > PATH". Rather, the convention is that an empty or null PAT
On Sun, 2019-09-08 at 13:38 +0200, Bruno Haible wrote:
> > the path search is done
> > on the _parent's_ PATH environment value not the one passed in to
> > posix_spawnp(). I don't want that, I need the search done in the
> > child's environment. I can't decide if this behavior by
> > posix_spawn
Hi Paul,
> I'm addressing https://savannah.gnu.org/bugs/?56834
>
> I want to invoke a child process, and I need the program I'm going to
> invoke to be searched for in a PATH which is (potentially) different
> than the PATH which is active in the parent.
>
> When you use execlp(), you can just a
On Sat, 2019-09-07 at 12:42 +0200, Bruno Haible wrote:
> Hi Paul,
> > find_prog_in_path() always uses the PATH value in the current
> > environment. It can be very useful to search for programs on
> > a path without having to modify the environment first.
> >
> > Provide find_in_path_str() which
Hi Paul,
> find_prog_in_path() always uses the PATH value in the current
> environment. It can be very useful to search for programs on
> a path without having to modify the environment first.
>
> Provide find_in_path_str() which takes a path string to search.
> If the path passed in is NULL, fa
I don't know if people would prefer to actually define two real
functions one of which just invokes the other, rather than use a
preprocessor macro to forward the old one to the new one.
I'm fine with it either way.
On Fri, 2019-09-06 at 19:10 -0400, Paul Smith wrote:
> find_prog_in_path() alway
find_prog_in_path() always uses the PATH value in the current
environment. It can be very useful to search for programs on
a path without having to modify the environment first.
Provide find_in_path_str() which takes a path string to search.
If the path passed in is NULL, fall back to searching i
14 matches
Mail list logo