Mail Archives: djgpp-workers/2001/02/09/03:43:22
> From: "Mark E." <snowball3 AT bigfoot DOT com>
> Date: Thu, 8 Feb 2001 14:15:25 -0500
>
> This fixes several problems found in dosexec.c.
Thanks.
> *************** int __spawnve(int mode, const char *path
> *** 1359,1384 ****
>
> if (!found)
> {
> ! const char *rpath_ext;
> !
> ! if (rd)
> ! {
> ! i = 0;
> ! rpath_ext = rd;
> ! }
> ! else
> ! {
> ! i = INTERP_NO_EXT;
> ! rpath_ext = "";
> ! }
> ! for ( ; interpreters[i].extension; i++)
> ! if (stricmp(rpath_ext, interpreters[i].extension) == 0
> ! && access(rpath, F_OK) == 0
> ! && !(is_dir = (access(rpath, D_OK) == 0)))
> ! {
> ! found = 1;
> ! break;
> ! }
> }
> if (!found)
> {
> --- 1367,1375 ----
>
> if (!found)
> {
> ! i = (rd) ? INTERP_OTHER_EXT : INTERP_NO_EXT;
> ! if (access(rpath, F_OK) == 0 && !(is_dir = (access(rpath, D_OK) == 0)))
> ! found = 1;
> }
> if (!found)
> {
This removes a chunk of code that was supposed to run files with one
of the known extensions, such as .com, .bat, .sh, etc. if they are
found in the current directory. For example, if the user invoked
"foo.bat", dosexec would call __dosexec_command_exec to run it. The
new code seems to funnel them all through script_exec. Did I miss
something?
When I asked for the files to go through script_exec, I meant only
those whose extensions are not part of the interpreters[] array.
Sorry if I was unclear.
- Raw text -