Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/bin/sh Revert previous. These changes are intended to get ...
details: https://anonhg.NetBSD.org/src/rev/3381c376c6fe
branches: trunk
changeset: 345138:3381c376c6fe
user: kre <kre%NetBSD.org@localhost>
date: Mon May 09 20:55:51 2016 +0000
description:
Revert previous. These changes are intended to get made (and will
be in a minute or two) but not as part of that commit... The log
entry certainly does not apply.
diffstat:
bin/sh/eval.c | 34 +++++++++++++++-------------------
bin/sh/eval.h | 8 +-------
bin/sh/main.c | 6 +++---
3 files changed, 19 insertions(+), 29 deletions(-)
diffs (179 lines):
diff -r 1e8e65d80ff1 -r 3381c376c6fe bin/sh/eval.c
--- a/bin/sh/eval.c Mon May 09 20:50:08 2016 +0000
+++ b/bin/sh/eval.c Mon May 09 20:55:51 2016 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: eval.c,v 1.123 2016/05/09 20:50:08 kre Exp $ */
+/* $NetBSD: eval.c,v 1.124 2016/05/09 20:55:51 kre Exp $ */
/*-
* Copyright (c) 1993
@@ -37,7 +37,7 @@
#if 0
static char sccsid[] = "@(#)eval.c 8.9 (Berkeley) 6/8/95";
#else
-__RCSID("$NetBSD: eval.c,v 1.123 2016/05/09 20:50:08 kre Exp $");
+__RCSID("$NetBSD: eval.c,v 1.124 2016/05/09 20:55:51 kre Exp $");
#endif
#endif /* not lint */
@@ -219,7 +219,7 @@
while ((n = parsecmd(0)) != NEOF) {
TRACE(("evalstring: "); showtree(n));
if (nflag == 0)
- evaltree(n, flag | EV_MORE);
+ evaltree(n, flag);
popstackmark(&smark);
}
popfile();
@@ -257,20 +257,19 @@
#endif
switch (n->type) {
case NSEMI:
- evaltree(n->nbinary.ch1, (flags & EV_TESTED) |
- (n->nbinary.ch2 ? EV_MORE : 0));
+ evaltree(n->nbinary.ch1, flags & EV_TESTED);
if (nflag || evalskip)
goto out;
evaltree(n->nbinary.ch2, flags);
break;
case NAND:
- evaltree(n->nbinary.ch1, EV_TESTED | EV_MORE);
+ evaltree(n->nbinary.ch1, EV_TESTED);
if (nflag || evalskip || exitstatus != 0)
goto out;
evaltree(n->nbinary.ch2, flags);
break;
case NOR:
- evaltree(n->nbinary.ch1, EV_TESTED | EV_MORE);
+ evaltree(n->nbinary.ch1, EV_TESTED);
if (nflag || evalskip || exitstatus == 0)
goto out;
evaltree(n->nbinary.ch2, flags);
@@ -282,14 +281,14 @@
popredir();
break;
case NSUBSHELL:
- evalsubshell(n, flags & ~EV_MORE);
+ evalsubshell(n, flags);
do_etest = !(flags & EV_TESTED);
break;
case NBACKGND:
- evalsubshell(n, flags & ~EV_MORE);
+ evalsubshell(n, flags);
break;
case NIF: {
- evaltree(n->nif.test, EV_TESTED | EV_MORE);
+ evaltree(n->nif.test, EV_TESTED);
if (nflag || evalskip)
goto out;
if (exitstatus == 0)
@@ -315,7 +314,7 @@
exitstatus = 0;
break;
case NNOT:
- evaltree(n->nnot.com, (flags & EV_MORE) | EV_TESTED);
+ evaltree(n->nnot.com, EV_TESTED);
exitstatus = !exitstatus;
break;
case NPIPE:
@@ -361,7 +360,7 @@
TRACE(("evalloop done\n"));
for (;;) {
- evaltree(n->nbinary.ch1, EV_TESTED | EV_MORE);
+ evaltree(n->nbinary.ch1, EV_TESTED);
if (nflag)
break;
if (evalskip) {
@@ -380,7 +379,7 @@
if (exitstatus == 0)
break;
}
- evaltree(n->nbinary.ch2, flags & (EV_TESTED | EV_MORE));
+ evaltree(n->nbinary.ch2, flags & EV_TESTED);
status = exitstatus;
if (evalskip)
goto skipping;
@@ -414,7 +413,7 @@
loopnest++;
for (sp = arglist.list ; sp ; sp = sp->next) {
setvar(n->nfor.var, sp->text, 0);
- evaltree(n->nfor.body, flags & (EV_TESTED | EV_MORE));
+ evaltree(n->nfor.body, flags & EV_TESTED);
status = exitstatus;
if (nflag)
break;
@@ -882,8 +881,6 @@
INTOFF;
jp = makejob(cmd, 1);
mode = cmd->ncmd.backgnd;
- if (mode)
- flags &= ~EV_MORE;
if (flags & EV_BACKCMD) {
mode = FORK_NOJOB;
if (sh_pipe(pip) < 0)
@@ -970,7 +967,7 @@
#ifdef DEBUG
trputs("Shell function: "); trargs(argv);
#endif
- redirect(cmd->ncmd.redirect, flags & EV_MORE ? REDIR_PUSH : 0);
+ redirect(cmd->ncmd.redirect, REDIR_PUSH);
saveparam = shellparam;
shellparam.malloc = 0;
shellparam.reset = 1;
@@ -1008,8 +1005,7 @@
freeparam(&shellparam);
shellparam = saveparam;
handler = savehandler;
- if (flags & EV_MORE)
- popredir();
+ popredir();
INTON;
if (evalskip == SKIPFUNC) {
evalskip = SKIPNONE;
diff -r 1e8e65d80ff1 -r 3381c376c6fe bin/sh/eval.h
--- a/bin/sh/eval.h Mon May 09 20:50:08 2016 +0000
+++ b/bin/sh/eval.h Mon May 09 20:55:51 2016 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: eval.h,v 1.17 2016/05/09 20:50:08 kre Exp $ */
+/* $NetBSD: eval.h,v 1.18 2016/05/09 20:55:51 kre Exp $ */
/*-
* Copyright (c) 1991, 1993
@@ -71,9 +71,3 @@
* Only for use by reset() in init.c!
*/
void reset_eval(void);
-
-/* flags in argument to evaltree */
-#define EV_EXIT 0x01 /* exit after evaluating tree */
-#define EV_TESTED 0x02 /* exit status is checked; ignore -e flag */
-#define EV_BACKCMD 0x04 /* command executing within back quotes */
-#define EV_MORE 0x08 /* more commands in this sub-shell */
diff -r 1e8e65d80ff1 -r 3381c376c6fe bin/sh/main.c
--- a/bin/sh/main.c Mon May 09 20:50:08 2016 +0000
+++ b/bin/sh/main.c Mon May 09 20:55:51 2016 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: main.c,v 1.65 2016/05/09 20:50:08 kre Exp $ */
+/* $NetBSD: main.c,v 1.66 2016/05/09 20:55:51 kre Exp $ */
/*-
* Copyright (c) 1991, 1993
@@ -42,7 +42,7 @@
#if 0
static char sccsid[] = "@(#)main.c 8.7 (Berkeley) 7/19/95";
#else
-__RCSID("$NetBSD: main.c,v 1.65 2016/05/09 20:50:08 kre Exp $");
+__RCSID("$NetBSD: main.c,v 1.66 2016/05/09 20:55:51 kre Exp $");
#endif
#endif /* not lint */
@@ -282,7 +282,7 @@
} else if (n != NULL && nflag == 0) {
job_warning = (job_warning == 2) ? 1 : 0;
numeof = 0;
- evaltree(n, EV_MORE);
+ evaltree(n, 0);
}
popstackmark(&smark);
setstackmark(&smark);
Home |
Main Index |
Thread Index |
Old Index