diff options
author | jilles <jilles@FreeBSD.org> | 2015-09-13 13:43:08 +0000 |
---|---|---|
committer | jilles <jilles@FreeBSD.org> | 2015-09-13 13:43:08 +0000 |
commit | 71d275cef177108a01d07a8d7eccb8bb1d189e6c (patch) | |
tree | ae8f5ff23a75d1cc74ed502e9f9c1288098b22c9 /bin/sh/eval.c | |
parent | e646354b485aa16f77c0346625c3c2834f3b8df5 (diff) | |
download | FreeBSD-src-71d275cef177108a01d07a8d7eccb8bb1d189e6c.zip FreeBSD-src-71d275cef177108a01d07a8d7eccb8bb1d189e6c.tar.gz |
MFC r272575: sh: Eliminate some gotos.
This MFC is to avoid conflicts in the MFC of r287148.
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 055d1cc..c8ae089 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)); |