delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/1999/02/02/12:39:04

Message-Id: <199902021738.RAA82350@out4.ibm.net>
From: "Mark E." <snowball3 AT usa DOT net>
To: djgpp-workers AT delorie DOT com
Date: Tue, 2 Feb 1999 12:38:42 -0500
MIME-Version: 1.0
Subject: Re: new bash 2.02.1binary
X-mailer: Pegasus Mail for Win32 (v3.01d)
Reply-To: djgpp-workers AT delorie DOT com

--Message-Boundary-23528
Content-type: text/plain; charset=US-ASCII
Content-transfer-encoding: 7BIT
Content-description: Mail message body

> Bash 1.14.7 always returns 0 from parenthesized commands.
...
> The question is: why
> does this force zero be returned instead of the actual exit status?

It turns out the exit status of a non-builtin program was ignored in most 
cases. Attached is a patch against the current 2.02.1 source.

Mark

--- 
Mark Elbrecht snowball3 AT usa DOT net
http://members.xoom.com/snowball3/


--Message-Boundary-23528
Content-type: text/plain; charset=US-ASCII
Content-transfer-encoding: 7BIT
Content-description: Text from file 'execute_cmd.dif'

*** execute_cmd.c.orig	Sun Jan 24 16:35:38 1999
--- execute_cmd.c	Tue Feb  2 12:21:14 1999
***************
*** 2811,2819 ****
    execute_disk_command (words, simple_command->redirects, command_line,
  			pipe_in, pipe_out, async, fds_to_close,
  			simple_command->flags);
  #if defined (__MSDOS__)
!   /* sh -c "foo": Return result code */
    if (startup_state == 2)
      {
        result = dosutil_wait_status;
        if ((result & 0x0000ff00) == 0x0000ff00)
--- 2811,2822 ----
    execute_disk_command (words, simple_command->redirects, command_line,
  			pipe_in, pipe_out, async, fds_to_close,
  			simple_command->flags);
  #if defined (__MSDOS__)
! /* Set result code. */
!   result = dosutil_wait_status;
! 
!   /* Set result code for sh -c "foo" */
    if (startup_state == 2)
      {
        result = dosutil_wait_status;
        if ((result & 0x0000ff00) == 0x0000ff00)

--Message-Boundary-23528--

- Raw text -


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