fix set -e with and/or inside functions regression (LP#1104543)

cause was that use of && or || inside function switched it to xerrok
This commit is contained in:
tg
2013-02-10 23:59:28 +00:00
parent 63cf38eca7
commit fb370a30c6
3 changed files with 22 additions and 8 deletions

5
exec.c
View File

@ -23,7 +23,7 @@
#include "sh.h"
__RCSID("$MirOS: src/bin/mksh/exec.c,v 1.113 2013/01/19 19:47:10 tg Exp $");
__RCSID("$MirOS: src/bin/mksh/exec.c,v 1.114 2013/02/10 23:59:25 tg Exp $");
#ifndef MKSH_DEFAULT_EXECSHELL
#define MKSH_DEFAULT_EXECSHELL "/bin/sh"
@ -748,8 +748,7 @@ comexec(struct op *t, struct tbl * volatile tp, const char **ap,
e->type = E_FUNC;
if (!(i = kshsetjmp(e->jbuf))) {
/* seems odd to pass XERROK here, but AT&T ksh does */
exstat = execute(tp->val.t, flags & XERROK, xerrok) & 0xFF;
execute(tp->val.t, 0, NULL);
i = LRETURN;
}
kshname = old_kshname;