diff options
author | jilles <jilles@FreeBSD.org> | 2014-10-05 21:51:36 +0000 |
---|---|---|
committer | jilles <jilles@FreeBSD.org> | 2014-10-05 21:51:36 +0000 |
commit | 8883e8ad3ea72532152caf26aaa12be04744a63f (patch) | |
tree | b00ee3e4cda755dd02e5000755469b550cf3c8ca /bin/sh/eval.c | |
parent | a25e91cfdb087b8b2986b66a6a47e8012daede14 (diff) | |
download | FreeBSD-src-8883e8ad3ea72532152caf26aaa12be04744a63f.zip FreeBSD-src-8883e8ad3ea72532152caf26aaa12be04744a63f.tar.gz |
sh: Eliminate some gotos.
Diffstat (limited to 'bin/sh/eval.c')
-rw-r--r-- | bin/sh/eval.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/bin/sh/eval.c b/bin/sh/eval.c index 3fd3050..ea2d264 100644 --- a/bin/sh/eval.c +++ b/bin/sh/eval.c @@ -316,9 +316,10 @@ evalloop(union node *n, int flags) loopnest++; status = 0; for (;;) { - evaltree(n->nbinary.ch1, EV_TESTED); + if (!evalskip) + evaltree(n->nbinary.ch1, EV_TESTED); if (evalskip) { -skipping: if (evalskip == SKIPCONT && --skipcount <= 0) { + if (evalskip == SKIPCONT && --skipcount <= 0) { evalskip = 0; continue; } @@ -337,8 +338,6 @@ skipping: if (evalskip == SKIPCONT && --skipcount <= 0) { } evaltree(n->nbinary.ch2, flags); status = exitstatus; - if (evalskip) - goto skipping; } loopnest--; exitstatus = status; @@ -648,15 +647,15 @@ evalbackcmd(union node *n, struct backcmd *result) struct jmploc *savehandler; struct localvar *savelocalvars; - setstackmark(&smark); result->fd = -1; result->buf = NULL; result->nleft = 0; result->jp = NULL; if (n == NULL) { exitstatus = 0; - goto out; + return; } + setstackmark(&smark); exitstatus = oexitstatus; if (is_valid_fast_cmdsubst(n)) { savelocalvars = localvars; @@ -698,7 +697,6 @@ evalbackcmd(union node *n, struct backcmd *result) result->fd = pip[0]; result->jp = jp; } -out: popstackmark(&smark); TRACE(("evalbackcmd done: fd=%d buf=%p nleft=%d jp=%p\n", result->fd, result->buf, result->nleft, result->jp)); |