www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2001/12/16/15:55:08

X-Authentication-Warning: delorie.com: mailnull set sender to djgpp-workers-bounces using -f
Date: Sun, 16 Dec 2001 22:36:38 +0200 (WET)
From: Andris Pavenis <pavenis AT lanet DOT lv>
X-Sender: pavenis AT ieva06
To: Tim Van Holder <tim DOT van DOT holder AT pandora DOT be>
Cc: djgpp-workers AT delorie DOT com
Subject: Re: Weird system() thing (was Re: The Bash 2.05 fixinc.sh bug)
In-Reply-To: <000e01c18663$db550130$d13276d5@pandora.be>
Message-ID: <Pine.A41.4.05.10112162231560.19034-100000@ieva06>
MIME-Version: 1.0
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


On Sun, 16 Dec 2001, Tim Van Holder wrote:

> > It can be reproduced in a nice 3 line makefile:
> > 
> > SHELL = /bin/sh
> > all:
> >         MAKE="$(MAKE)"
> > 
> > make on this with bash being 2.04 works fine, on 2.05 gives the binary
> > file error (using bash 2.05 from cvs build directory on clio).  Yes,
> > that's a tab before the MAKE.
> 
> I tried to see if this was relatd to system() in
> any way, and clearly it was not (system("FOO=$FOO") works fine).
> 
> But I did find a different, very weird bug (which I don't recall being
> mentioned before): while
> 
> int
> main(void)
> {
>   system("");
> }
> 
> and
> 
> int
> main(void)
> {
>   system("Foo=bar");
> }
> 
> 
> both, as expected, spawn a single instance of command.com, and exit
> after
> that shell is exited, the following does not:
> 
> int
> main(void)
> {
>   system("");
>   system("Foo=bar");
> }

I guess Your executable were named foo.exe. 
                                   ========

In this case it's not surprising. I fell into the same trap.
Tested it under DOSEMU-1.0.2 running under Linux (in SSH session as I'm
currently about 300 km away)

As far as I tested system ("Foo=bar") is interpretted as
'Foo "=bar"' 

Andris

> 
> I'd expect this to run command.com, when that's exited run it again, and
> then exit.  But instead I get a seemingly infinite series of
> command.coms;
> the only way to get out seems to be to type Ctrl-C, as that causes the
> executable to SIGINT out after exiting the subshell.
> 
> This is with straight clio packages for djdev & gcc3.  It does not
> happen
> with two 'system("")' calls.
> 
> 
> 
> 



- Raw text -


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