mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-09 01:29:17 +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:
parent
50473003be
commit
5ec139e728
Notes:
sideshowbarker
2024-07-18 23:03:40 +09:00
Author: https://github.com/alimpfard
Commit: 5ec139e728
Pull-request: https://github.com/SerenityOS/serenity/pull/4996
3 changed files with 14 additions and 4 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue