search for: poplocalvars

Displaying 13 results from an estimated 13 matches for "poplocalvars".

2019 Jan 25
0
[klibc:update-dash] [VAR] Add newline when tracing in poplocalvars
....git;a=commit;h=f885a1bc99e1c7b98fb6ffd8e93d4cd34cf0306a Author: Peter Rosin <peda at lysator.liu.se> AuthorDate: Fri, 23 Aug 2013 20:54:19 +1000 Committer: Ben Hutchings <ben at decadent.org.uk> CommitDate: Fri, 25 Jan 2019 02:57:21 +0000 [klibc] [VAR] Add newline when tracing in poplocalvars Signed-off-by: Peter Rosin <peda at lysator.liu.se> Signed-off-by: Herbert Xu <herbert at gondor.apana.org.au> Signed-off-by: Ben Hutchings <ben at decadent.org.uk> --- usr/dash/var.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr/dash/var.c b/usr/dash/...
2020 Mar 28
0
[klibc:update-dash] dash: [VAR] Add newline when tracing in poplocalvars
...=commit;h=cd3104d4d44a7723a93c2c316ea60a2d6ab83677 Author: Peter Rosin <peda at lysator.liu.se> AuthorDate: Fri, 23 Aug 2013 20:54:19 +1000 Committer: Ben Hutchings <ben at decadent.org.uk> CommitDate: Sat, 28 Mar 2020 21:42:54 +0000 [klibc] dash: [VAR] Add newline when tracing in poplocalvars [ dash commit 14f70561a50fc8eba75b818a4705fed44da2ba2e ] Signed-off-by: Peter Rosin <peda at lysator.liu.se> Signed-off-by: Herbert Xu <herbert at gondor.apana.org.au> Signed-off-by: Ben Hutchings <ben at decadent.org.uk> --- usr/dash/var.c | 2 +- 1 file changed, 1 insertion(...
2011 Jun 14
0
klibc 1.5.23 release
...(22): [klibc] [VAR] Add localvars nesting [klibc] [VAR] Fix poplocalvar leak [klibc] [VAR] Move unsetvar functionality into setvareq [klibc] [VAR] Replace cmdenviron with localvars [klibc] [VAR] Fix poplocalvar on abnormal exit from function [klibc] [VAR] Do not poplocalvars prematurely on regular utilities [klibc] [REDIR] Move null redirect checks into caller [klibc] [REDIR] Fix popredir on abnormal exit from built-in [klibc] [JOBS] Fix wait regression where it does not wait for all jobs [klibc] [BUILTIN] Continue after EINTR in read(1) wit...
2019 Jan 25
0
[klibc:update-dash] eval: Variable assignments on functions are no longer persistent
...ff-by: Ben Hutchings <ben at decadent.org.uk> --- usr/dash/eval.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/usr/dash/eval.c b/usr/dash/eval.c index 5fd1c7c1..2f662e3e 100644 --- a/usr/dash/eval.c +++ b/usr/dash/eval.c @@ -886,7 +886,6 @@ raise: break; case CMDFUNCTION: - poplocalvars(1); if (evalfun(cmdentry.u.func, argc, argv, flags)) goto raise; break; @@ -971,9 +970,7 @@ evalfun(struct funcnode *func, int argc, char **argv, int flags) shellparam.p = argv + 1; shellparam.optind = 1; shellparam.optoff = -1; - pushlocalvars(); evaltree(func->n.ndefun.body,...
2020 Mar 28
0
[klibc:update-dash] dash: eval: Variable assignments on functions are no longer persistent
...ff-by: Ben Hutchings <ben at decadent.org.uk> --- usr/dash/eval.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/usr/dash/eval.c b/usr/dash/eval.c index e28e56cb..722066e5 100644 --- a/usr/dash/eval.c +++ b/usr/dash/eval.c @@ -886,7 +886,6 @@ raise: break; case CMDFUNCTION: - poplocalvars(1); if (evalfun(cmdentry.u.func, argc, argv, flags)) goto raise; break; @@ -971,9 +970,7 @@ evalfun(struct funcnode *func, int argc, char **argv, int flags) shellparam.p = argv + 1; shellparam.optind = 1; shellparam.optoff = -1; - pushlocalvars(); evaltree(func->n.ndefun.body,...
2020 Mar 28
0
[klibc:update-dash] dash: eval: Always set localvar_stop
...localvar_stop); if (lastarg) /* dsl: I think this is intended to be used to support * '_' in 'vi' command mode during line editing... diff --git a/usr/dash/var.c b/usr/dash/var.c index 40743e5d..0d7e1db0 100644 --- a/usr/dash/var.c +++ b/usr/dash/var.c @@ -562,18 +562,24 @@ poplocalvars(int keep) /* * Create a new localvar environment. */ -struct localvar_list *pushlocalvars(void) +struct localvar_list *pushlocalvars(int push) { struct localvar_list *ll; + struct localvar_list *top; + + top = localvar_stack; + if (!push) + goto out; INTOFF; ll = ckmalloc(sizeof(*ll)...
2020 Mar 28
0
[klibc:update-dash] dash: eval: Replace with listsetvar with mklocal/setvareq
...} jp = NULL; @@ -881,17 +897,10 @@ bail: break; FORCEINTON; } - listsetvar(varlist.list, VEXPORT|VSTACK); - path = unlikely(path) ? path : pathval(); shellexec(argv, path, cmdentry.u.index); /* NOTREACHED */ case CMDBUILTIN: - if (spclbltin > 0 || argc == 0) { - poplocalvars(1); - if (execcmd && argc > 1) - listsetvar(varlist.list, VEXPORT); - } if (evalbltin(cmdentry.u.cmd, argc, argv, flags) && !(exception == EXERROR && spclbltin <= 0)) { raise: @@ -913,7 +922,8 @@ out: popredir(execcmd); unwindredir(redir_stop);...
2019 Jan 25
0
[klibc:update-dash] [BUILTIN] Do not allow break to break across function calls
...node *func, int argc, char **argv, int flags) shellparam.malloc = 0; func->count++; funcline = func->n.ndefun.linno; + loopnest = 0; INTON; shellparam.nparam = argc - 1; shellparam.p = argv + 1; @@ -950,6 +953,7 @@ evalfun(struct funcnode *func, int argc, char **argv, int flags) poplocalvars(0); funcdone: INTOFF; + loopnest = saveloopnest; funcline = savefuncline; freefunc(func); freeparam(&shellparam);
2020 Mar 28
0
[klibc:update-dash] dash: [BUILTIN] Do not allow break to break across function calls
...node *func, int argc, char **argv, int flags) shellparam.malloc = 0; func->count++; funcline = func->n.ndefun.linno; + loopnest = 0; INTON; shellparam.nparam = argc - 1; shellparam.p = argv + 1; @@ -950,6 +953,7 @@ evalfun(struct funcnode *func, int argc, char **argv, int flags) poplocalvars(0); funcdone: INTOFF; + loopnest = saveloopnest; funcline = savefuncline; freefunc(func); freeparam(&shellparam);
2019 Jan 25
0
[klibc:update-dash] eval: Reap zombies after built-in commands and functions
...-875,22 +876,22 @@ bail: if (evalbltin(cmdentry.u.cmd, argc, argv, flags)) { if (exception == EXERROR && spclbltin <= 0) { FORCEINTON; - goto readstatus; + break; } raise: longjmp(handler->loc, 1); } - goto readstatus; + break; case CMDFUNCTION: poplocalvars(1); if (evalfun(cmdentry.u.func, argc, argv, flags)) goto raise; -readstatus: - status = exitstatus; break; } + status = waitforjob(jp); + out: if (cmd->ncmd.redirect) popredir(execcmd); diff --git a/usr/dash/jobs.c b/usr/dash/jobs.c index a2602bae..4548ae69 100644 --- a/usr...
2020 Mar 28
0
[klibc:update-dash] dash: eval: Reap zombies after built-in commands and functions
...-875,22 +876,22 @@ bail: if (evalbltin(cmdentry.u.cmd, argc, argv, flags)) { if (exception == EXERROR && spclbltin <= 0) { FORCEINTON; - goto readstatus; + break; } raise: longjmp(handler->loc, 1); } - goto readstatus; + break; case CMDFUNCTION: poplocalvars(1); if (evalfun(cmdentry.u.func, argc, argv, flags)) goto raise; -readstatus: - status = exitstatus; break; } + status = waitforjob(jp); + out: if (cmd->ncmd.redirect) popredir(execcmd); diff --git a/usr/dash/jobs.c b/usr/dash/jobs.c index 333a2a22..3ea7e122 100644 --- a/usr...
2019 Jan 25
0
[klibc:update-dash] eval: Return status in eval functions
...-868,17 +875,19 @@ bail: if (evalbltin(cmdentry.u.cmd, argc, argv, flags)) { if (exception == EXERROR && spclbltin <= 0) { FORCEINTON; - break; + goto readstatus; } raise: longjmp(handler->loc, 1); } - break; + goto readstatus; case CMDFUNCTION: poplocalvars(1); if (evalfun(cmdentry.u.func, argc, argv, flags)) goto raise; +readstatus: + status = exitstatus; break; } @@ -894,6 +903,8 @@ out: */ setvar("_", lastarg, 0); popstackmark(&smark); + + return status; } STATIC int diff --git a/usr/dash/eval.h b/usr/dash/...
2020 Mar 28
0
[klibc:update-dash] dash: eval: Return status in eval functions
...-868,17 +875,19 @@ bail: if (evalbltin(cmdentry.u.cmd, argc, argv, flags)) { if (exception == EXERROR && spclbltin <= 0) { FORCEINTON; - break; + goto readstatus; } raise: longjmp(handler->loc, 1); } - break; + goto readstatus; case CMDFUNCTION: poplocalvars(1); if (evalfun(cmdentry.u.func, argc, argv, flags)) goto raise; +readstatus: + status = exitstatus; break; } @@ -894,6 +903,8 @@ out: */ setvar("_", lastarg, 0); popstackmark(&smark); + + return status; } STATIC int diff --git a/usr/dash/eval.h b/usr/dash/...