diff options
author | AnotherTest <ali.mpfard@gmail.com> | 2020-08-14 22:30:48 +0430 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-08-15 20:48:17 +0200 |
commit | c589625418e444164b6732ac9f4e1908a9bdbc5c (patch) | |
tree | 1d0671db2ead01637c2651e414037b7d72a9057c /Shell/Shell.cpp | |
parent | 0dac7af6c500f224741dd76027efd2003a5e675a (diff) | |
download | serenity-c589625418e444164b6732ac9f4e1908a9bdbc5c.zip |
Shell: Allow redirections and pipes on builtins
Fixes #3072.
Diffstat (limited to 'Shell/Shell.cpp')
-rw-r--r-- | Shell/Shell.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Shell/Shell.cpp b/Shell/Shell.cpp index b9d621f16c..33b16074bb 100644 --- a/Shell/Shell.cpp +++ b/Shell/Shell.cpp @@ -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"); |