1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-18 12:05:07 +00:00

LibLine: Change get_line to return a Result<String, Error>

This fixes a bunch of FIXME's in LibLine.
Also handles the case where read() would read zero bytes in vt_dsr() and
effectively block forever by erroring out.

Fixes #2370
This commit is contained in:
AnotherTest 2020-05-25 16:57:07 +04:30 committed by Andreas Kling
parent 1e30ef239b
commit bc9013f706
7 changed files with 87 additions and 22 deletions

View file

@ -236,7 +236,13 @@ int main(int argc, char** argv)
}
for (;;) {
auto command = editor.get_line("(sdb) ");
auto command_result = editor.get_line("(sdb) ");
if (command_result.is_error())
return DebugSession::DebugDecision::Detach;
auto& command = command_result.value();
bool success = false;
Optional<DebugSession::DebugDecision> decision;