Shell: flush stderr and stdout when using builtins

This fixed some tests that were failing.
Thanks @alimpfard for this fix!
This commit is contained in:
jacob gw 2021-04-12 15:35:43 -04:00 committed by Andreas Kling
parent cb22a6642d
commit 42e63d0a94
Notes: sideshowbarker 2024-07-18 20:26:40 +09:00

View File

@ -1010,6 +1010,8 @@ bool Shell::run_builtin(const AST::Command& command, const NonnullRefPtrVector<A
retval = builtin_##builtin(argv.size() - 1, argv.data()); \ retval = builtin_##builtin(argv.size() - 1, argv.data()); \
if (!has_error(ShellError::None)) \ if (!has_error(ShellError::None)) \
raise_error(m_error, m_error_description, command.position); \ raise_error(m_error, m_error_description, command.position); \
fflush(stdout); \
fflush(stderr); \
return true; \ return true; \
} }