patch from oksh (except manpage, I'll merge that later):
pass "xerrok" status across the execution call stack to more closely match what both POSIX and [18]ksh.1 already describe in regards to set -e/errexit's behavior in determining when to exit from nonzero return values. specifically, the truth values tested as operands to &&' and ||', as well as the resulting compound expression itself, along with the truth value resulting from a negated command (i.e. a pipeline prefixed !'), should not make the shell exit when -e is in effect. issue reported by matthieu. testing matthieu, naddy. ok miod (earlier version), otto. man page ok jmc.
This commit is contained in:
6
eval.c
6
eval.c
@ -1,8 +1,8 @@
|
||||
/* $OpenBSD: eval.c,v 1.33 2007/08/02 11:05:54 fgsch Exp $ */
|
||||
/* $OpenBSD: eval.c,v 1.34 2009/01/29 23:27:26 jaredy Exp $ */
|
||||
|
||||
#include "sh.h"
|
||||
|
||||
__RCSID("$MirOS: src/bin/mksh/eval.c,v 1.52 2009/03/14 18:12:51 tg Exp $");
|
||||
__RCSID("$MirOS: src/bin/mksh/eval.c,v 1.53 2009/03/22 17:47:35 tg Exp $");
|
||||
|
||||
#ifdef MKSH_SMALL
|
||||
#define MKSH_NOPWNAM
|
||||
@ -1069,7 +1069,7 @@ comsub(Expand *xp, const char *cp)
|
||||
ksh_dup2(pv[1], 1, false);
|
||||
close(pv[1]);
|
||||
}
|
||||
execute(t, XFORK|XXCOM|XPIPEO);
|
||||
execute(t, XFORK|XXCOM|XPIPEO, NULL);
|
||||
restfd(1, ofd1);
|
||||
startlast();
|
||||
xp->split = 1; /* waitlast() */
|
||||
|
Reference in New Issue
Block a user