undo fix for Debian PR #71256 which turned to be bogus and break make(1)

This commit is contained in:
tg 2005-07-07 22:00:45 +00:00
parent fb64668227
commit 3506838417
3 changed files with 10 additions and 21 deletions

View File

@ -1,4 +1,4 @@
# $MirOS: src/bin/mksh/check.t,v 1.24 2005/07/06 00:02:05 tg Exp $
# $MirOS: src/bin/mksh/check.t,v 1.25 2005/07/07 22:00:45 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 $
@ -3681,7 +3681,7 @@ expected-stderr:
---
name: errexit-2
description:
Check some "exit on error" edge conditions
Check some "exit on error" edge conditions needed for make(1)
stdin:
set -ex
if /usr/bin/env true; then
@ -3689,11 +3689,10 @@ stdin:
fi
echo END
expected-stdout:
END
expected-stderr:
+ /usr/bin/env true
+ /usr/bin/env false
+ echo END
expected-exit: 1
---
name: version-1
description:
@ -3702,5 +3701,5 @@ category: pdksh
stdin:
echo $KSH_VERSION
expected-stdout:
@(#)MIRBSD KSH R24 2005/07/06
@(#)MIRBSD KSH R24 2005/07/07
---

16
exec.c
View File

@ -1,11 +1,11 @@
/** $MirOS: src/bin/mksh/exec.c,v 1.7 2005/07/04 12:34:22 tg Exp $ */
/** $MirOS: src/bin/mksh/exec.c,v 1.8 2005/07/07 22:00:45 tg Exp $ */
/* $OpenBSD: exec.c,v 1.41 2005/03/30 17:16:37 deraadt Exp $ */
#include "sh.h"
#include <sys/stat.h>
#include <ctype.h>
__RCSID("$MirOS: src/bin/mksh/exec.c,v 1.7 2005/07/04 12:34:22 tg Exp $");
__RCSID("$MirOS: src/bin/mksh/exec.c,v 1.8 2005/07/07 22:00:45 tg Exp $");
static int comexec(struct op *, struct tbl *volatile, char **,
int volatile);
@ -30,7 +30,6 @@ execute(struct op *volatile t,
{
int i;
volatile int rv = 0;
volatile int rv_prop = 0; /* rv being propogated or newly generated? */
int pv[2];
char ** volatile ap;
char *s, *cp;
@ -112,7 +111,6 @@ execute(struct op *volatile t,
case TPAREN:
rv = execute(t->left, flags|XFORK);
rv_prop = 1;
break;
case TPIPE:
@ -225,7 +223,6 @@ execute(struct op *volatile t,
rv = execute(t->right, flags & XERROK);
else
flags |= XERROK;
rv_prop = 1;
break;
case TBANG:
@ -268,7 +265,6 @@ execute(struct op *volatile t,
}
}
rv = 0; /* in case of a continue */
rv_prop = 1;
if (t->type == TFOR) {
while (*ap != NULL) {
setstr(global(t->str), *ap++, KSH_UNWIND_ERROR);
@ -278,7 +274,6 @@ execute(struct op *volatile t,
for (;;) {
if (!(cp = do_selectargs(ap, is_first))) {
rv = 1;
rv_prop = 0;
break;
}
is_first = false;
@ -308,7 +303,6 @@ execute(struct op *volatile t,
rv = 0; /* in case of a continue */
while ((execute(t->left, XERROK) == 0) == (t->type == TWHILE))
rv = execute(t->right, flags & XERROK);
rv_prop = 1;
break;
case TIF:
@ -318,7 +312,6 @@ execute(struct op *volatile t,
rv = execute(t->left, XERROK) == 0 ?
execute(t->right->left, flags & XERROK) :
execute(t->right->right, flags & XERROK);
rv_prop = 1;
break;
case TCASE:
@ -331,12 +324,10 @@ execute(struct op *volatile t,
break;
Found:
rv = execute(t->left, flags & XERROK);
rv_prop = 1;
break;
case TBRACE:
rv = execute(t->left, flags & XERROK);
rv_prop = 1;
break;
case TFUNCT:
@ -348,7 +339,6 @@ execute(struct op *volatile t,
* (allows "ls -l | time grep foo").
*/
rv = timex(t, flags & ~XEXEC);
rv_prop = 1;
break;
case TEXEC: /* an eval'd TCOM */
@ -369,7 +359,7 @@ execute(struct op *volatile t,
if ((flags&XEXEC))
unwind(LEXIT); /* exit child */
if (rv != 0 && !(flags & XERROK)) {
if (Flag(FERREXIT) && !rv_prop)
if (Flag(FERREXIT))
unwind(LERROR);
trapsig(SIGERR_);
}

6
main.c
View File

@ -1,4 +1,4 @@
/** $MirOS: src/bin/mksh/main.c,v 1.21 2005/07/06 00:02:06 tg Exp $ */
/** $MirOS: src/bin/mksh/main.c,v 1.22 2005/07/07 22:00:45 tg Exp $ */
/* $OpenBSD: main.c,v 1.38 2005/03/30 17:16:37 deraadt Exp $ */
/* $OpenBSD: tty.c,v 1.8 2005/03/30 17:16:37 deraadt Exp $ */
/* $OpenBSD: io.c,v 1.21 2005/03/30 17:16:37 deraadt Exp $ */
@ -13,9 +13,9 @@
#include <time.h>
#endif
__RCSID("$MirOS: src/bin/mksh/main.c,v 1.21 2005/07/06 00:02:06 tg Exp $");
__RCSID("$MirOS: src/bin/mksh/main.c,v 1.22 2005/07/07 22:00:45 tg Exp $");
const char ksh_version[] = "@(#)MIRBSD KSH R24 2005/07/06";
const char ksh_version[] = "@(#)MIRBSD KSH R24 2005/07/07";
extern char **environ;