summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--shell/ash.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/shell/ash.c b/shell/ash.c
index b594714..53c1409 100644
--- a/shell/ash.c
+++ b/shell/ash.c
@@ -10278,6 +10278,9 @@ evalcommand(union node *cmd, int flags)
/* First expand the arguments. */
TRACE(("evalcommand(0x%lx, %d) called\n", (long)cmd, flags));
+#if BASH_PROCESS_SUBST
+ redir_stop = redirlist;
+#endif
file_stop = g_parsefile;
back_exitstatus = 0;
@@ -10356,7 +10359,11 @@ evalcommand(union node *cmd, int flags)
lastarg = nargv[-1];
expredir(cmd->ncmd.redirect);
+#if !BASH_PROCESS_SUBST
redir_stop = pushredir(cmd->ncmd.redirect);
+#else
+ pushredir(cmd->ncmd.redirect);
+#endif
preverrout_fd = 2;
if (BASH_XTRACEFD && xflag) {
/* NB: bash closes fd == $BASH_XTRACEFD when it is changed.
@@ -13477,9 +13484,6 @@ cmdloop(int top)
if (doing_jobctl)
showjobs(SHOW_CHANGED|SHOW_STDERR);
#endif
-#if BASH_PROCESS_SUBST
- unwindredir(NULL);
-#endif
inter = 0;
if (iflag && top) {
inter++;