Mail Archives: djgpp-workers/2001/07/07/13:12:50
> From: "Mark E." <snowball3 AT bigfoot DOT com>
> Date: Sat, 7 Jul 2001 12:10:03 -0400
>
> > Shouldn't we add another test like this after an extension is
> > appended?
>
> I have no idea. If you think it's needed, I'll add it.
Please do. Better be safe than sorry ;-)
> Rev 3 below:
Given this definition of find_extension:
> static int
> find_extension (const char *path, char *ext)
> {
> int i, is_dir;
>
> for (i = 0; interpreters[i].extension; ++i)
> {
> if (interpreters[i].flags & INTERP_FLAG_SKIP_SEARCH)
> continue;
> strcpy(ext, interpreters[i].extension);
> if (access(path, F_OK) == 0 && (is_dir = access(path, D_OK)) != 0)
> return i;
> }
I think you should call it in the fragment below with second argument
`rd', not `rp'. Other than that, I don't have any comments; the code
is fine with me.
> for (rp=rpath; *path; *rp++ = *path++)
> {
> if (*path == '.')
> rd = rp;
> if (*path == '\\' || *path == '/')
> rd = 0;
> }
> *rp = 0;
>
> /* Perform an extension search when the flag SPAWN_INTERP_SEARCH is not
> present. If LFN is supported on the volume where rpath resides, we
> might have something like foo.bar.exe or even foo.exe.com.
> If so, look for RPATH.ext before even trying RPATH itself.
> Otherwise, try to add an extension to a file without one. */
> if (flags & SPAWN_FLAG_EXTENSION_SEARCH)
> {
> if (_use_lfn(path) || !rd)
> {
> i = find_extension(rpath, rp);
> I notice the 'p' variants of spawn will find foo.sh given foo while spawnve
> wouldn't.
That's because we didn't change __dosexec_find_on_path to match the
changes in __spawnve (now __djgpp_spawn).
> It seems to me both should be consistent.
Yes, definitely.
- Raw text -