1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-14 20:24:57 +00:00

Shell: Allow redirections and pipes on builtins

Fixes #3072.
This commit is contained in:
AnotherTest 2020-08-14 22:30:48 +04:30 committed by Andreas Kling
parent 0dac7af6c5
commit c589625418
6 changed files with 81 additions and 13 deletions

View file

@ -500,6 +500,10 @@ RefPtr<Job> Shell::run_command(const AST::Command& command)
return nullptr;
}
int retval = 0;
if (run_builtin(command, rewirings, retval))
return nullptr;
Vector<const char*> argv;
Vector<String> copy_argv = command.argv;
argv.ensure_capacity(command.argv.size() + 1);
@ -509,10 +513,6 @@ RefPtr<Job> Shell::run_command(const AST::Command& command)
argv.append(nullptr);
int retval = 0;
if (run_builtin(argv.size() - 1, argv.data(), retval))
return nullptr;
int sync_pipe[2];
if (pipe(sync_pipe) < 0) {
perror("pipe");