search for: 6cc92c19

Displaying 2 results from an estimated 2 matches for "6cc92c19".

2020 Mar 28
0
[klibc:update-dash] dash: [BUILTIN] Allow return in loop conditional to set exit status
...elas <stephane_chazelas at yahoo.fr> Signed-off-by: Herbert Xu <herbert at gondor.apana.org.au> Signed-off-by: Ben Hutchings <ben at decadent.org.uk> --- usr/dash/eval.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/usr/dash/eval.c b/usr/dash/eval.c index 6cc92c19..bb9fc260 100644 --- a/usr/dash/eval.c +++ b/usr/dash/eval.c @@ -387,8 +387,9 @@ evalloop(union node *n, int flags) status = exitstatus; skip = skiploop(); } while (!(skip & ~SKIPCONT)); + if (skip != SKIPFUNC) + exitstatus = status; loopnest--; - exitstatus = status; }
2020 Mar 28
0
[klibc:update-dash] dash: [EVAL] Move common skipcount logic into skiploop
...u <herbert at gondor.apana.org.au> Signed-off-by: Ben Hutchings <ben at decadent.org.uk> --- usr/dash/eval.c | 56 +++++++++++++++++++++++++++++++------------------------- 1 file changed, 31 insertions(+), 25 deletions(-) diff --git a/usr/dash/eval.c b/usr/dash/eval.c index e0c21f94..6cc92c19 100644 --- a/usr/dash/eval.c +++ b/usr/dash/eval.c @@ -339,27 +339,45 @@ void evaltreenr(union node *n, int flags) #endif +static int skiploop(void) +{ + int skip = evalskip; + + switch (skip) { + case 0: + break; + + case SKIPBREAK: + case SKIPCONT: + if (likely(--skipcount <= 0)) { +...