mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 21:17:44 +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
1 changed files with 1 additions and 1 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue