Mail Archives: djgpp-workers/1998/10/31/13:33:27
When run in a DOS box under Win95, the following will invariably raise a
Win95 GPF dialog box and close the DOS session:
<--------- test.bat ---------->
echo "hello world"
<--------- end test.bat ------->
<--------- test.c -------------->
#include <stdlib.h>
int main(void) {
system("test.bat");
return 0;
}
<--------- end test.c ----------->
The fault occurs whether test.exe is invoked from command.com or bash,
and with SHELL set to
command.com, /bin/sh/ , or reset entirely. I left COMSPEC as command.com
in all instances. The error
is only when a "bat" file is passed as a parameter. system("cat
test.bat"); works fine.
The same code will work from straight DOS with no problem with all
combinations of shells and SHELL settings. There was also no problem
with the prior implementation of 'system'.
- Raw text -