search for: evalbackcmd

Displaying 11 results from an estimated 11 matches for "evalbackcmd".

2012 Jul 02
0
[klibc:master] [EVAL] Remove unused EV_BACKCMD flag
...EV_TESTED 02 /* exit status is checked; ignore -e flag */ -#define EV_BACKCMD 04 /* command executing within back quotes */ int evalskip; /* set if we are skipping commands */ STATIC int skipcount; /* number of levels to skip */ @@ -594,6 +593,9 @@ evalpipe(union node *n, int flags) void evalbackcmd(union node *n, struct backcmd *result) { + int pip[2]; + struct job *jp; + result->fd = -1; result->buf = NULL; result->nleft = 0; @@ -602,52 +604,24 @@ evalbackcmd(union node *n, struct backcmd *result) goto out; } -#ifdef notyet - /* - * For now we disable executing builti...
2011 Jun 14
0
klibc 1.5.23 release
...a=summary Thanks a lot for all your contributions, belows shortlog tells the longer story. maks Brian Koropoff (2): [klibc] [SHELL] Port to AIX [klibc] [SHELL] Port to Solaris Gerrit Pape (4): [klibc] [EVAL] Fix command -- crash [klibc] [EVAL] Don't clear eflag in evalbackcmd [klibc] [EVAL] Check exit for eval NSUBSHELL [klibc] [INPUT] Use exit status 127 when the script to run does not exist Harald van Dijk (2): [klibc] [EVAL] Let funcnode refer to a function definition, not its first command [klibc] [SHELL] Improve LINENO support Herb...
2019 Jan 25
0
[klibc:update-dash] eval: Return status in eval functions
...4,6 +903,8 @@ out: */ setvar("_", lastarg, 0); popstackmark(&smark); + + return status; } STATIC int diff --git a/usr/dash/eval.h b/usr/dash/eval.h index 6e8acdaf..63e7d865 100644 --- a/usr/dash/eval.h +++ b/usr/dash/eval.h @@ -53,7 +53,7 @@ struct backcmd { /* result of evalbackcmd */ int evalstring(char *, int); union node; /* BLETCH for ansi C */ -void evaltree(union node *, int); +int evaltree(union node *, int); void evalbackcmd(union node *, struct backcmd *); extern int evalskip; diff --git a/usr/dash/main.c b/usr/dash/main.c index 497ac160..fcd3e7d2 100644 ---...
2020 Mar 28
0
[klibc:update-dash] dash: eval: Return status in eval functions
...4,6 +903,8 @@ out: */ setvar("_", lastarg, 0); popstackmark(&smark); + + return status; } STATIC int diff --git a/usr/dash/eval.h b/usr/dash/eval.h index 6e8acdaf..63e7d865 100644 --- a/usr/dash/eval.h +++ b/usr/dash/eval.h @@ -53,7 +53,7 @@ struct backcmd { /* result of evalbackcmd */ int evalstring(char *, int); union node; /* BLETCH for ansi C */ -void evaltree(union node *, int); +int evaltree(union node *, int); void evalbackcmd(union node *, struct backcmd *); extern int evalskip; diff --git a/usr/dash/main.c b/usr/dash/main.c index 497ac160..fcd3e7d2 100644 ---...
2020 Mar 28
0
[klibc:update-dash] dash: eval: Reset handler when entering a subshell
....redirect, 0); evaltreenr(n->nredir.n, flags); /* never returns */ @@ -574,6 +576,7 @@ evalpipe(union node *n, int flags) } } if (forkshell(jp, lp->n, n->npipe.backgnd) == 0) { + reset_handler(); INTON; if (pip[1] >= 0) { close(pip[0]); @@ -630,6 +633,7 @@ evalbackcmd(union node *n, struct backcmd *result) sh_error("Pipe call failed"); jp = makejob(n, 1); if (forkshell(jp, n, FORK_NOJOB) == 0) { + reset_handler(); FORCEINTON; close(pip[0]); if (pip[1] != 1) { diff --git a/usr/dash/main.c b/usr/dash/main.c index 6b3a0909..b2712cbd 10064...
2019 Jan 25
0
[klibc:update-dash] [BUILTIN] Exit without arguments in a trap should use status outside traps
...@ extern char *commandname; /* currently executing command */ extern int exitstatus; /* exit status of last command */ extern int back_exitstatus; /* exit status of backquoted command */ +extern int savestatus; /* exit status of last command outside traps */ struct backcmd { /* result of evalbackcmd */ diff --git a/usr/dash/main.c b/usr/dash/main.c index f79ad7dd..29a258d3 100644 --- a/usr/dash/main.c +++ b/usr/dash/main.c @@ -339,8 +339,15 @@ exitcmd(int argc, char **argv) { if (stoppedjobs()) return 0; - if (argc > 1) - exitstatus = number(argv[1]); + + if (argc > 1) { + int st...
2020 Mar 28
0
[klibc:update-dash] dash: [BUILTIN] Exit without arguments in a trap should use status outside traps
...@ extern char *commandname; /* currently executing command */ extern int exitstatus; /* exit status of last command */ extern int back_exitstatus; /* exit status of backquoted command */ +extern int savestatus; /* exit status of last command outside traps */ struct backcmd { /* result of evalbackcmd */ diff --git a/usr/dash/main.c b/usr/dash/main.c index f79ad7dd..29a258d3 100644 --- a/usr/dash/main.c +++ b/usr/dash/main.c @@ -339,8 +339,15 @@ exitcmd(int argc, char **argv) { if (stoppedjobs()) return 0; - if (argc > 1) - exitstatus = number(argv[1]); + + if (argc > 1) { + int st...
2020 Mar 28
0
[klibc:update-dash] dash: parser: Fix old-style command substitution here-document crash
...:11 > #3 0x576017 in redirectsafe /home/jfe/dash/src/redir.c:424:3 > #4 0x522326 in evalcommand /home/jfe/dash/src/eval.c:828:11 > #5 0x520010 in evaltree /home/jfe/dash/src/eval.c:288:12 > #6 0x5270da in evaltreenr /home/jfe/dash/src/eval.c:332:2 > #7 0x526f04 in evalbackcmd /home/jfe/dash/src/eval.c:640:3 > #8 0x539020 in expbackq /home/jfe/dash/src/expand.c:522:2 > #9 0x5332d7 in argstr /home/jfe/dash/src/expand.c:343:4 > #10 0x5322f7 in expandarg /home/jfe/dash/src/expand.c:196:2 > #11 0x528118 in fill_arglist /home/jfe/dash/src/eval.c:65...
2007 Aug 23
0
[git patch] klibc dash 0.5.4 update
...Make eval with empty arguments return 0 Fixed inverted char class matching Fixed command -v segmentation fault Fix mkbuiltin sort order Fix typo in comment Remove unnecessary inclusion of redir.h Remove EMFILE special case Use dup2 instead of copyfd in evalbackcmd Replace copyfd by savefd and use dup2 elsewhere Remove redundant CLOEXEC calls Fix redirect restore on saved file descriptors Size optimisations in redir.c Release 0.5.4. maximilian attems (1): README.klibc: dash update to latest HEAD with the following diffsta...
2019 Jan 25
0
[klibc:update-dash] [SHELL] Optimize dash -c "command" to avoid a fork
...evaltree(n, flags & ~(parser_eof() ? 0 : EV_EXIT)); status = exitstatus; popstackmark(&smark); if (evalskip) diff --git a/usr/dash/eval.h b/usr/dash/eval.h index 5ccfa9f1..dc8acd2a 100644 --- a/usr/dash/eval.h +++ b/usr/dash/eval.h @@ -46,6 +46,10 @@ struct backcmd { /* result of evalbackcmd */ struct job *jp; /* job structure for command */ }; +/* flags in argument to evaltree */ +#define EV_EXIT 01 /* exit after evaluating tree */ +#define EV_TESTED 02 /* exit status is checked; ignore -e flag */ + int evalstring(char *, int); union node; /* BLETCH for ansi C */ void evalt...
2020 Mar 28
0
[klibc:update-dash] dash: [SHELL] Optimize dash -c "command" to avoid a fork
...evaltree(n, flags & ~(parser_eof() ? 0 : EV_EXIT)); status = exitstatus; popstackmark(&smark); if (evalskip) diff --git a/usr/dash/eval.h b/usr/dash/eval.h index 5ccfa9f1..dc8acd2a 100644 --- a/usr/dash/eval.h +++ b/usr/dash/eval.h @@ -46,6 +46,10 @@ struct backcmd { /* result of evalbackcmd */ struct job *jp; /* job structure for command */ }; +/* flags in argument to evaltree */ +#define EV_EXIT 01 /* exit after evaluating tree */ +#define EV_TESTED 02 /* exit status is checked; ignore -e flag */ + int evalstring(char *, int); union node; /* BLETCH for ansi C */ void evalt...