Displaying 7 results from an estimated 7 matches for "redir_stop".
2019 Jan 25
0
[klibc:update-dash] eval: Restore input files in evalcommand
...2 deletions(-)
diff --git a/usr/dash/eval.c b/usr/dash/eval.c
index 811c28a4..5fd1c7c1 100644
--- a/usr/dash/eval.c
+++ b/usr/dash/eval.c
@@ -694,6 +694,7 @@ evalcommand(union node *cmd, int flags)
#endif
{
struct localvar_list *localvar_stop;
+ struct parsefile *file_stop;
struct redirtab *redir_stop;
struct stackmark smark;
union node *argp;
@@ -722,6 +723,7 @@ evalcommand(union node *cmd, int flags)
TRACE(("evalcommand(0x%lx, %d) called\n", (long)cmd, flags));
setstackmark(&smark);
localvar_stop = pushlocalvars();
+ file_stop = parsefile;
back_exitstatus = 0;
cmd...
2020 Mar 28
0
[klibc:update-dash] dash: eval: Restore input files in evalcommand
...2 deletions(-)
diff --git a/usr/dash/eval.c b/usr/dash/eval.c
index 26055493..e28e56cb 100644
--- a/usr/dash/eval.c
+++ b/usr/dash/eval.c
@@ -694,6 +694,7 @@ evalcommand(union node *cmd, int flags)
#endif
{
struct localvar_list *localvar_stop;
+ struct parsefile *file_stop;
struct redirtab *redir_stop;
struct stackmark smark;
union node *argp;
@@ -722,6 +723,7 @@ evalcommand(union node *cmd, int flags)
TRACE(("evalcommand(0x%lx, %d) called\n", (long)cmd, flags));
setstackmark(&smark);
localvar_stop = pushlocalvars();
+ file_stop = parsefile;
back_exitstatus = 0;
cmd...
2020 Mar 28
0
[klibc:update-dash] dash: eval: Replace with listsetvar with mklocal/setvareq
...4,9 @@ evalcommand(union node *cmd, int flags)
for (sp = arglist.list; sp; sp = sp->next)
argc++;
+
+ if (execcmd && argc > 1)
+ vflags = VEXPORT;
}
/* Reserve one extra spot at the front for shellexec. */
@@ -818,7 +827,8 @@ evalcommand(union node *cmd, int flags)
redir_stop = pushredir(cmd->ncmd.redirect);
status = redirectsafe(cmd->ncmd.redirect, REDIR_PUSH|REDIR_SAVEFD2);
- if (status) {
+ if (unlikely(status)) {
+ vlocal = 0;
bail:
exitstatus = status;
@@ -829,13 +839,19 @@ bail:
goto out;
}
+ if (likely(vlocal))
+ localvar_stop = pushlocal...
2020 Mar 28
0
[klibc:update-dash] dash: eval: Fail immediately with redirections errors for simple command
...--
usr/dash/eval.c | 36 ++++++++++++++++++------------------
1 file changed, 18 insertions(+), 18 deletions(-)
diff --git a/usr/dash/eval.c b/usr/dash/eval.c
index 9e88fef2..fc5a594a 100644
--- a/usr/dash/eval.c
+++ b/usr/dash/eval.c
@@ -818,6 +818,17 @@ evalcommand(union node *cmd, int flags)
redir_stop = pushredir(cmd->ncmd.redirect);
status = redirectsafe(cmd->ncmd.redirect, REDIR_PUSH|REDIR_SAVEFD2);
+ if (status) {
+bail:
+ exitstatus = status;
+
+ /* We have a redirection error. */
+ if (spclbltin > 0)
+ exraise(EXERROR);
+
+ goto out;
+ }
+
for (argp = cmd->ncmd.assig...
2020 Mar 28
0
[klibc:update-dash] dash: eval: Always set localvar_stop
...0;
bail:
exitstatus = status;
@@ -839,9 +840,6 @@ bail:
goto out;
}
- if (likely(vlocal))
- localvar_stop = pushlocalvars();
-
for (argp = cmd->ncmd.assign; argp; argp = argp->narg.next) {
struct strlist **spp;
@@ -920,8 +918,7 @@ out:
popredir(execcmd);
unwindredir(redir_stop);
unwindfiles(file_stop);
- if (likely(vlocal))
- unwindlocalvars(localvar_stop);
+ unwindlocalvars(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/das...
2020 Mar 28
0
[klibc:update-dash] dash: eval: avoid leaking memory associated with redirections
...; cp = cp->nclist.next) {
@@ -459,8 +460,6 @@ evalcase(union node *n, int flags)
}
}
out:
- popstackmark(&smark);
-
return status;
}
@@ -717,7 +716,6 @@ evalcommand(union node *cmd, int flags)
struct localvar_list *localvar_stop;
struct parsefile *file_stop;
struct redirtab *redir_stop;
- struct stackmark smark;
union node *argp;
struct arglist arglist;
struct arglist varlist;
@@ -746,7 +744,6 @@ evalcommand(union node *cmd, int flags)
/* First expand the arguments. */
TRACE(("evalcommand(0x%lx, %d) called\n", (long)cmd, flags));
- setstackmark(&smark);...
2020 Mar 28
0
[klibc:update-dash] dash: eval: Add assignment built-in support again
...gt;narg.next)
+ expandarg(argp, &arglist,
+ pseudovarflag &&
+ isassignment(argp->narg.text) ?
+ EXP_VARTILDE : EXP_FULL | EXP_TILDE);
+
+ for (sp = arglist.list; sp; sp = sp->next)
argc++;
}
@@ -761,23 +818,13 @@ evalcommand(union node *cmd, int flags)
redir_stop = pushredir(cmd->ncmd.redirect);
status = redirectsafe(cmd->ncmd.redirect, REDIR_PUSH|REDIR_SAVEFD2);
- path = vpath.text;
for (argp = cmd->ncmd.assign; argp; argp = argp->narg.next) {
struct strlist **spp;
- char *p;
spp = varlist.lastp;
expandarg(argp, &varlist,...