From ec883318d1904b7fe5770efa3bbf6263a115c4af Mon Sep 17 00:00:00 2001 From: tg Date: Fri, 15 Feb 2013 18:50:14 +0000 Subject: [PATCH] fix too strict fix for LP#1104543 (Debian #700526) --- check.t | 18 +++++++++++++++--- exec.c | 4 ++-- sh.h | 4 ++-- 3 files changed, 19 insertions(+), 7 deletions(-) diff --git a/check.t b/check.t index 2441a8f..22f1eb3 100644 --- a/check.t +++ b/check.t @@ -1,4 +1,4 @@ -# $MirOS: src/bin/mksh/check.t,v 1.593 2013/02/11 13:06:54 tg Exp $ +# $MirOS: src/bin/mksh/check.t,v 1.594 2013/02/15 18:50:11 tg Exp $ # $OpenBSD: bksl-nl.t,v 1.2 2001/01/28 23:04:56 niklas Exp $ # $OpenBSD: history.t,v 1.5 2001/01/28 23:04:56 niklas Exp $ # $OpenBSD: read.t,v 1.3 2003/03/10 03:48:16 david Exp $ @@ -29,7 +29,7 @@ # http://www.freebsd.org/cgi/cvsweb.cgi/src/tools/regression/bin/test/regress.sh?rev=HEAD expected-stdout: - @(#)MIRBSD KSH R42 2013/02/10 + @(#)MIRBSD KSH R42 2013/02/15 description: Check version of shell. stdin: @@ -38,7 +38,7 @@ name: KSH_VERSION category: shell:legacy-no --- expected-stdout: - @(#)LEGACY KSH R42 2013/02/10 + @(#)LEGACY KSH R42 2013/02/15 description: Check version of legacy shell. stdin: @@ -5769,6 +5769,18 @@ expected-stdout: x expected-exit: 1 --- +name: exit-err-8 +description: + "set -e" regression (Debian #700526) +stdin: + set -e + _db_cmd() { return $1; } + db_input() { _db_cmd 30; } + db_go() { _db_cmd 0; } + db_input || : + db_go + exit 0 +--- name: exit-enoent-1 description: SUSv4 says that the shell should exit with 126/127 in some situations diff --git a/exec.c b/exec.c index 3643456..9d4b319 100644 --- a/exec.c +++ b/exec.c @@ -23,7 +23,7 @@ #include "sh.h" -__RCSID("$MirOS: src/bin/mksh/exec.c,v 1.114 2013/02/10 23:59:25 tg Exp $"); +__RCSID("$MirOS: src/bin/mksh/exec.c,v 1.115 2013/02/15 18:50:13 tg Exp $"); #ifndef MKSH_DEFAULT_EXECSHELL #define MKSH_DEFAULT_EXECSHELL "/bin/sh" @@ -748,7 +748,7 @@ comexec(struct op *t, struct tbl * volatile tp, const char **ap, e->type = E_FUNC; if (!(i = kshsetjmp(e->jbuf))) { - execute(tp->val.t, 0, NULL); + execute(tp->val.t, flags & XERROK, NULL); i = LRETURN; } kshname = old_kshname; diff --git a/sh.h b/sh.h index 0f6846e..8137645 100644 --- a/sh.h +++ b/sh.h @@ -164,9 +164,9 @@ #endif #ifdef EXTERN -__RCSID("$MirOS: src/bin/mksh/sh.h,v 1.634 2013/02/10 23:59:28 tg Exp $"); +__RCSID("$MirOS: src/bin/mksh/sh.h,v 1.635 2013/02/15 18:50:14 tg Exp $"); #endif -#define MKSH_VERSION "R42 2013/02/10" +#define MKSH_VERSION "R42 2013/02/15" /* arithmetic types: C implementation */ #if !HAVE_CAN_INTTYPES