summaryrefslogtreecommitdiff
path: root/Userland/test-crypto.cpp
diff options
context:
space:
mode:
authorAnotherTest <ali.mpfard@gmail.com>2020-05-25 16:57:07 +0430
committerAndreas Kling <kling@serenityos.org>2020-05-25 21:36:51 +0200
commitbc9013f7064fec7d0b6fe1d8513a62761978acad (patch)
tree82dca471709d6d9a5521963a6867104a876680d3 /Userland/test-crypto.cpp
parent1e30ef239ba3a6a1108a11d25dc3024f4bdda029 (diff)
downloadserenity-bc9013f7064fec7d0b6fe1d8513a62761978acad.zip
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
Diffstat (limited to 'Userland/test-crypto.cpp')
-rw-r--r--Userland/test-crypto.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/Userland/test-crypto.cpp b/Userland/test-crypto.cpp
index 4f22de89c1..a209f473cd 100644
--- a/Userland/test-crypto.cpp
+++ b/Userland/test-crypto.cpp
@@ -113,7 +113,12 @@ int run(Function<void(const char*, size_t)> fn)
Line::Editor editor;
editor.initialize();
for (;;) {
- auto line = editor.get_line("> ");
+ auto line_result = editor.get_line("> ");
+
+ if (line_result.is_error())
+ break;
+ auto& line = line_result.value();
+
if (line == ".wait") {
loop.exec();
} else {