mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-02-24 00:24:38 +00:00
Shell: Properly handle parser syntax errors
In the case of a syntax error the shell parser prints an error message to stderr and returns an empty Vector<Command> - in that case we shouldn't try to determine whether or not we can continue parsing but abort immediately - is_complete() expects that *something* was parsed successfully. Fixes #2251.
This commit is contained in:
committed by
Andreas Kling
parent
5ee79e6657
commit
b11c7ad2ba
@@ -857,6 +857,9 @@ static ExitCodeOrContinuationRequest run_command(const StringView& cmd)
|
||||
|
||||
auto commands = Parser(cmd).parse();
|
||||
|
||||
if (!commands.size())
|
||||
return 1;
|
||||
|
||||
auto needs_more = is_complete(commands);
|
||||
if (needs_more != ExitCodeOrContinuationRequest::Nothing)
|
||||
return needs_more;
|
||||
|
||||
Reference in New Issue
Block a user