X-Authentication-Warning: delorie.com: mailnull set sender to djgpp-workers-bounces using -f From: "Tim Van Holder" To: Subject: Weird system() thing (was Re: The Bash 2.05 fixinc.sh bug) Date: Sun, 16 Dec 2001 19:59:58 +0100 Message-ID: <000e01c18663$db550130$d13276d5@pandora.be> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook, Build 10.0.2627 In-Reply-To: <10112160731.AA15388@clio.rice.edu> X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2462.0000 Importance: Normal 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 Precedence: bulk > 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'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.