www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2001/07/07/13:12:50

Date: Sat, 07 Jul 2001 20:10:03 +0300
From: "Eli Zaretskii" <eliz AT is DOT elta DOT co DOT il>
Sender: halo1 AT zahav DOT net DOT il
To: "Mark E." <snowball3 AT bigfoot DOT com>
Message-Id: <3791-Sat07Jul2001201003+0300-eliz@is.elta.co.il>
X-Mailer: Emacs 20.6 (via feedmail 8.3.emacs20_6 I) and Blat ver 1.8.9
CC: djgpp-workers AT delorie DOT com
In-reply-to: <3B46FC1B.14992.4A1DB3@localhost> (snowball3@bigfoot.com)
Subject: Re: dosexec.c changes
References: <3B45C9F9 DOT 1814 DOT A88009 AT localhost> (snowball3 AT bigfoot DOT com) <3B46FC1B DOT 14992 DOT 4A1DB3 AT localhost>
Reply-To: djgpp-workers AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp-workers AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

> 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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019