summaryrefslogtreecommitdiff
path: root/execute_cmd.c
diff options
context:
space:
mode:
authorChet Ramey <chet.ramey@case.edu>2011-12-07 09:07:10 -0500
committerChet Ramey <chet.ramey@case.edu>2011-12-07 09:07:10 -0500
commitb709b946e4d1e9a039d99afef24cefc5ca1ea614 (patch)
treef6e2a5540fcd445f2b61a2fc0b2229c3c08085a3 /execute_cmd.c
parentc184f64511d31b4d986a1c545b3cb1461f2b7011 (diff)
downloadbash-b709b946e4d1e9a039d99afef24cefc5ca1ea614.tar.gz
commit bash-20070426 snapshot
Diffstat (limited to 'execute_cmd.c')
-rw-r--r--execute_cmd.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/execute_cmd.c b/execute_cmd.c
index 1f19991e..3f1b8632 100644
--- a/execute_cmd.c
+++ b/execute_cmd.c
@@ -3496,13 +3496,18 @@ execute_subshell_builtin_or_function (words, redirects, builtin, var,
else
{
r = execute_builtin (builtin, words, flags, 1);
+ fflush (stdout);
if (r == EX_USAGE)
r = EX_BADUSAGE;
exit (r);
}
}
else
- exit (execute_function (var, words, flags, fds_to_close, async, 1));
+ {
+ r = execute_function (var, words, flags, fds_to_close, async, 1);
+ fflush (stdout);
+ exit (r);
+ }
}
/* Execute a builtin or function in the current shell context. If BUILTIN
@@ -3562,6 +3567,7 @@ execute_builtin_or_function (words, builtin, var, redirects,
result = execute_function (var, words, flags, fds_to_close, 0, 0);
/* We do this before undoing the effects of any redirections. */
+ fflush (stdout);
if (ferror (stdout))
clearerr (stdout);