mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 05:18:12 +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:
parent
5ee79e6657
commit
b11c7ad2ba
1 changed files with 3 additions and 0 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue