mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-08 17:47:18 +00:00
Shell: Make 'if' expressions return the unevaluated value of blocks
This makes it possible to actually put them in a sequence and cast them to commands.
This commit is contained in:
committed by
Andreas Kling
parent
50473003be
commit
5ec139e728
@@ -730,7 +730,12 @@ RefPtr<Job> Shell::run_command(const AST::Command& command)
|
||||
}
|
||||
}
|
||||
|
||||
if (command.argv.is_empty() && !command.next_chain.is_empty() && command.should_immediately_execute_next && command.next_chain.first().node->should_override_execution_in_current_process()) {
|
||||
if (command.argv.is_empty()
|
||||
&& !command.next_chain.is_empty()
|
||||
&& command.should_immediately_execute_next
|
||||
&& command.redirections.is_empty()
|
||||
&& command.next_chain.first().node->should_override_execution_in_current_process()) {
|
||||
|
||||
for (auto& next_in_chain : command.next_chain)
|
||||
run_tail(command, next_in_chain, last_return_code);
|
||||
return nullptr;
|
||||
|
||||
Reference in New Issue
Block a user