mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 07:07:34 +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
1 changed files with 8 additions and 1 deletions
|
@ -879,7 +879,7 @@ CloseFdRedirection::~CloseFdRedirection()
|
||||||
void CommandLiteral::dump(int level) const
|
void CommandLiteral::dump(int level) const
|
||||||
{
|
{
|
||||||
Node::dump(level);
|
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>)
|
RefPtr<Value> CommandLiteral::run(RefPtr<Shell>)
|
||||||
|
@ -2036,6 +2036,13 @@ RefPtr<Value> Join::run(RefPtr<Shell> shell)
|
||||||
if (shell && shell->has_any_error())
|
if (shell && shell->has_any_error())
|
||||||
return make_ref_counted<ListValue>({});
|
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);
|
auto right = m_right->to_lazy_evaluated_commands(shell);
|
||||||
if (shell && shell->has_any_error())
|
if (shell && shell->has_any_error())
|
||||||
return make_ref_counted<ListValue>({});
|
return make_ref_counted<ListValue>({});
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue