From 4981b30ea5783348ba0e72adc3a418f651d434a7 Mon Sep 17 00:00:00 2001 From: AnotherTest Date: Wed, 20 Jan 2021 06:56:10 +0330 Subject: [PATCH] Shell: Run the command's next chain even when it's empty --- Userland/Shell/Shell.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Userland/Shell/Shell.cpp b/Userland/Shell/Shell.cpp index 5d7006a614..06595a2f0f 100644 --- a/Userland/Shell/Shell.cpp +++ b/Userland/Shell/Shell.cpp @@ -614,6 +614,8 @@ RefPtr Shell::run_command(const AST::Command& command) // If the command is empty, store the redirections and apply them to all later commands. if (command.argv.is_empty() && !command.should_immediately_execute_next) { m_global_redirections.append(command.redirections); + for (auto& next_in_chain : command.next_chain) + run_tail(command, next_in_chain, last_return_code); return nullptr; }