mirror of
https://github.com/SerenityOS/serenity
synced 2024-07-09 13:30:45 +00:00
Shell: Avoid infinite loop when parsing heredoc entry in POSIX mode
Previously, the shell would enter an infinite loop when attempting to parse a heredoc entry within a `$(` command substitution.
This commit is contained in:
parent
c170dd323e
commit
ff81513634
|
@ -250,7 +250,7 @@ ErrorOr<Lexer::ReductionResult> Lexer::reduce_operator()
|
|||
auto result = TRY(reduce(Reduction::Start));
|
||||
tokens.extend(move(result.tokens));
|
||||
|
||||
while (expect_heredoc_entry && tokens.size() == 1) {
|
||||
while (expect_heredoc_entry && tokens.size() == 1 && result.next_reduction != Reduction::None) {
|
||||
result = TRY(reduce(result.next_reduction));
|
||||
tokens.extend(move(result.tokens));
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user