diff --git a/check.t b/check.t index b2cc7ff..2202e39 100644 --- a/check.t +++ b/check.t @@ -1,4 +1,4 @@ -# $MirOS: src/bin/mksh/check.t,v 1.129 2007/07/23 14:28:51 tg Exp $ +# $MirOS: src/bin/mksh/check.t,v 1.130 2007/07/24 11:22:03 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 $ @@ -7,7 +7,7 @@ # http://www.research.att.com/~gsf/public/ifs.sh expected-stdout: - @(#)MIRBSD KSH R30 2007/07/23 + @(#)MIRBSD KSH R30 2007/07/24 description: Check version of shell. category: pdksh @@ -3736,6 +3736,23 @@ expected-stderr: + /usr/bin/env false expected-exit: e != 0 --- +name: errexit-3 +description: + pdksh regression which AT&T ksh does right + TFM says: [set] -e | errexit + Exit (after executing the ERR trap) ... +stdin: + trap 'echo EXIT' EXIT + trap 'echo ERR' ERR + set -e + cd /XXXXX 2>/dev/null + echo DONE + exit 0 +expected-stdout: + ERR + EXIT +expected-exit: e != 0 +--- name: test-stlt-1 description: Check that test also can handle string1 < string2 etc. diff --git a/exec.c b/exec.c index 75dceb7..14a2d0a 100644 --- a/exec.c +++ b/exec.c @@ -2,7 +2,7 @@ #include "sh.h" -__RCSID("$MirOS: src/bin/mksh/exec.c,v 1.36 2007/07/22 14:01:48 tg Exp $"); +__RCSID("$MirOS: src/bin/mksh/exec.c,v 1.37 2007/07/24 11:22:04 tg Exp $"); static int comexec(struct op *, struct tbl *volatile, const char **, int volatile); @@ -362,9 +362,9 @@ execute(struct op *volatile t, if ((flags&XEXEC)) unwind(LEXIT); /* exit child */ if (rv != 0 && !(flags & XERROK)) { + trapsig(SIGERR_); if (Flag(FERREXIT)) unwind(LERROR); - trapsig(SIGERR_); } return rv; } diff --git a/sh.h b/sh.h index 0362b84..53d1797 100644 --- a/sh.h +++ b/sh.h @@ -8,8 +8,8 @@ /* $OpenBSD: c_test.h,v 1.4 2004/12/20 11:34:26 otto Exp $ */ /* $OpenBSD: tty.h,v 1.5 2004/12/20 11:34:26 otto Exp $ */ -#define MKSH_SH_H_ID "$MirOS: src/bin/mksh/sh.h,v 1.162 2007/07/23 14:28:52 tg Exp $" -#define MKSH_VERSION "R30 2007/07/23" +#define MKSH_SH_H_ID "$MirOS: src/bin/mksh/sh.h,v 1.163 2007/07/24 11:22:04 tg Exp $" +#define MKSH_VERSION "R30 2007/07/24" #if HAVE_SYS_PARAM_H #include