delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/1998/10/31/13:33:27

Message-ID: <363B5765.2511F67B@montana.com>
Date: Sat, 31 Oct 1998 11:31:01 -0700
From: bowman <bowman AT montana DOT com>
X-Mailer: Mozilla 4.5b2 [en] (Win95; I)
X-Accept-Language: en
MIME-Version: 1.0
To: djgpp-workers AT delorie DOT com
Subject: 2.02 beta 'system'
Reply-To: djgpp-workers AT delorie DOT com

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 -


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