From 5ff36b379e83ca2bdf12e96b108ac5079730c383 Mon Sep 17 00:00:00 2001 From: Adam David Date: Thu, 12 Sep 1996 12:41:46 +0000 Subject: [PATCH] Mend 'exit' without breaking 'exit 1' *blush* %-\ Pointed out by: bruce --- bin/sh/main.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/bin/sh/main.c b/bin/sh/main.c index 53daced530d5..13ce050e1cb1 100644 --- a/bin/sh/main.c +++ b/bin/sh/main.c @@ -33,7 +33,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: main.c,v 1.6 1996/09/08 03:12:22 adam Exp $ + * $Id: main.c,v 1.7 1996/09/12 02:23:33 bde Exp $ */ #ifndef lint @@ -339,10 +339,11 @@ exitcmd(argc, argv) int argc; char **argv; { + extern int oexitstatus; + if (stoppedjobs()) return 0; - if (argc > 1) - exitstatus = number(argv[1]); + exitstatus = (argc > 1) ? number(argv[1]) : oexitstatus; exitshell(exitstatus); /*NOTREACHED*/ return 0;