search for: skipfunc

Displaying 8 results from an estimated 8 matches for "skipfunc".

2012 Jul 02
0
[klibc:master] [BUILTIN] Merge SKIPFUNC/ SKIPFILE and only clear SKIPFUNC when leaving dotcmd
...=libs/klibc/klibc.git;a=commit;h=21b878467fc1d46f8155e0f5ada315d741869262 Author: Herbert Xu <herbert at gondor.apana.org.au> AuthorDate: Sat, 9 Jul 2011 22:05:22 +0800 Committer: maximilian attems <max at stro.at> CommitDate: Mon, 2 Jul 2012 10:45:36 +0200 [klibc] [BUILTIN] Merge SKIPFUNC/SKIPFILE and only clear SKIPFUNC when leaving dotcmd Currently upon leaving a dotcmd the evalskip state is reset so if a continue/break statement is used within a dot script it would have no effect outside of the dot script. This is inconsistent with other shells. This patch is based on one by J...
2019 Jan 25
0
[klibc:update-dash] [BUILTIN] Return without arguments in a trap should use status outside traps
...trap.c | 3 ++- 4 files changed, 18 insertions(+), 5 deletions(-) diff --git a/usr/dash/eval.c b/usr/dash/eval.c index 57db825b..db7639a4 100644 --- a/usr/dash/eval.c +++ b/usr/dash/eval.c @@ -967,7 +967,7 @@ funcdone: shellparam = saveparam; handler = savehandler; INTON; - evalskip &= ~SKIPFUNC; + evalskip &= ~(SKIPFUNC | SKIPFUNCDEF); return e; } @@ -1047,12 +1047,23 @@ breakcmd(int argc, char **argv) int returncmd(int argc, char **argv) { + int skip; + int status; + /* * If called outside a function, do what ksh does; * skip the rest of the file. */ - evalskip = S...
2020 Mar 28
0
[klibc:update-dash] dash: [BUILTIN] Return without arguments in a trap should use status outside traps
...trap.c | 3 ++- 4 files changed, 18 insertions(+), 5 deletions(-) diff --git a/usr/dash/eval.c b/usr/dash/eval.c index bb9fc260..3325cb62 100644 --- a/usr/dash/eval.c +++ b/usr/dash/eval.c @@ -967,7 +967,7 @@ funcdone: shellparam = saveparam; handler = savehandler; INTON; - evalskip &= ~SKIPFUNC; + evalskip &= ~(SKIPFUNC | SKIPFUNCDEF); return e; } @@ -1047,12 +1047,23 @@ breakcmd(int argc, char **argv) int returncmd(int argc, char **argv) { + int skip; + int status; + /* * If called outside a function, do what ksh does; * skip the rest of the file. */ - evalskip = S...
2012 Oct 05
0
2.0.2 klibc release
...t LINEO support H. Peter Anvin (1): [klibc] 2.0.1 released, next version is 2.0.2 Harald van Dijk (1): [klibc] [ARITH] Avoid imaxdiv when only one of the results is wanted Herbert Xu (3): [klibc] [BUILTIN] Eliminate unnecessary promotion in echocmd [klibc] [BUILTIN] Merge SKIPFUNC/SKIPFILE and only clear SKIPFUNC when leaving dotcmd [klibc] [VAR] Sanitise environment variable names on entry Jim Meyering (4): [klibc] [MEMALLOC] Avoid gcc warning: variable 'oldstackp' set but not used [klibc] [MEMALLOC] Avoid clang warning about dead store to "s...
2019 Jan 25
0
[klibc:update-dash] eval: Return status in eval functions
...kiploop(void) } -STATIC void +STATIC int evalloop(union node *n, int flags) { int skip; @@ -375,33 +369,34 @@ evalloop(union node *n, int flags) do { int i; - evaltree(n->nbinary.ch1, EV_TESTED); + i = evaltree(n->nbinary.ch1, EV_TESTED); skip = skiploop(); + if (skip == SKIPFUNC) + status = i; if (skip) continue; - i = exitstatus; if (n->type != NWHILE) i = !i; if (i != 0) break; - evaltree(n->nbinary.ch2, flags); - status = exitstatus; + status = evaltree(n->nbinary.ch2, flags); skip = skiploop(); } while (!(skip & ~SKIPCONT));...
2020 Mar 28
0
[klibc:update-dash] dash: eval: Return status in eval functions
...kiploop(void) } -STATIC void +STATIC int evalloop(union node *n, int flags) { int skip; @@ -375,33 +369,34 @@ evalloop(union node *n, int flags) do { int i; - evaltree(n->nbinary.ch1, EV_TESTED); + i = evaltree(n->nbinary.ch1, EV_TESTED); skip = skiploop(); + if (skip == SKIPFUNC) + status = i; if (skip) continue; - i = exitstatus; if (n->type != NWHILE) i = !i; if (i != 0) break; - evaltree(n->nbinary.ch2, flags); - status = exitstatus; + status = evaltree(n->nbinary.ch2, flags); skip = skiploop(); } while (!(skip & ~SKIPCONT));...
2019 Jan 25
0
[klibc:update-dash] [BUILTIN] Allow return in loop conditional to set exit status
...tions(+), 1 deletion(-) diff --git a/usr/dash/eval.c b/usr/dash/eval.c index bb106368..57db825b 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: [BUILTIN] Allow return in loop conditional to set exit status
...tions(+), 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; }