Mail Archives: djgpp-workers/2001/03/29/11:21:45
On Thu, 29 Mar 2001, Mark E. wrote:
> I can confirm the return code is 0 when LFN=Y and is as expected when LFN=N. I traced
> the code path taken in dosexec.c when LFN=N and LFN=Y. When LFN=N, choice.com is
> executed via direct_exec and when LFN=Y, choice.com is executed via go32_exec. And
> when executed via go32_exec, it's changed to "%COMSPEC%/command.com /c choice.com".
> And I assume the return value is eaten by command.com.
Does the change below solve the problem?
Index: djgpp/src/libc/dos/process/dosexec.c
===================================================================
RCS file: /cvs/djgpp/djgpp/src/libc/dos/process/dosexec.c,v
retrieving revision 1.12
diff -u -p -r1.12 dosexec.c
--- dosexec.c 2001/02/10 20:44:52 1.12
+++ dosexec.c 2001/03/29 16:19:44
@@ -778,7 +778,10 @@ static int go32_exec(const char *program
/* Non-DJGPP programs cannot be run by !proxy. */
else if (!is_coff)
{
- if (type->exec_format == _V2_EXEC_FORMAT_EXE)
+ const char *ext = strrchr(real_program, '.');
+
+ if (type->exec_format == _V2_EXEC_FORMAT_EXE
+ || (ext && stricmp(ext, ".com") == 0))
{
if (type->object_format != _V2_OBJECT_FORMAT_PE_COFF)
return direct_exec(real_program, argv, envp);
@@ -1241,7 +1244,7 @@ __dosexec_find_on_path(const char *progr
{
/* If some of the `access' calls failed, `errno' will hold
the reason for the failure which is irrelevant to the
- caller (we *did* find the execuatble). Restore the value
+ caller (we *did* find the executable). Restore the value
`errno' had when we were called. */
errno = e;
return buf;
- Raw text -