mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 23:50:19 +00:00
Shell: Make the Join operation respect nodes that have a next chain
This would show up when resolving aliases, when an alias contains a sequence. Fixes #11219.
This commit is contained in:
parent
18f053ac31
commit
6bf50bc40b
Notes:
sideshowbarker
2024-07-17 22:49:36 +09:00
Author: https://github.com/alimpfard Commit: https://github.com/SerenityOS/serenity/commit/6bf50bc40bb Pull-request: https://github.com/SerenityOS/serenity/pull/11227 Issue: https://github.com/SerenityOS/serenity/issues/11219
1 changed files with 8 additions and 1 deletions
|
@ -879,7 +879,7 @@ CloseFdRedirection::~CloseFdRedirection()
|
|||
void CommandLiteral::dump(int level) const
|
||||
{
|
||||
Node::dump(level);
|
||||
print_indented("(Generated command literal)", level + 1);
|
||||
print_indented(String::formatted("(Generated command literal: {})", m_command), level + 1);
|
||||
}
|
||||
|
||||
RefPtr<Value> CommandLiteral::run(RefPtr<Shell>)
|
||||
|
@ -2036,6 +2036,13 @@ RefPtr<Value> Join::run(RefPtr<Shell> shell)
|
|||
if (shell && shell->has_any_error())
|
||||
return make_ref_counted<ListValue>({});
|
||||
|
||||
if (left.last().should_wait && !left.last().next_chain.is_empty()) {
|
||||
// Join (C0s*; C1) X -> (C0s*; Join C1 X)
|
||||
auto& lhs_node = left.last().next_chain.last().node;
|
||||
lhs_node = make_ref_counted<Join>(m_position, lhs_node, m_right);
|
||||
return make_ref_counted<CommandSequenceValue>(move(left));
|
||||
}
|
||||
|
||||
auto right = m_right->to_lazy_evaluated_commands(shell);
|
||||
if (shell && shell->has_any_error())
|
||||
return make_ref_counted<ListValue>({});
|
||||
|
|
Loading…
Reference in a new issue