From 4735fc10f8236a1de35cc23ee301dc0c9644e2cb Mon Sep 17 00:00:00 2001 From: Patrick Wuttke Date: Thu, 19 Sep 2024 15:21:05 +0200 Subject: [PATCH] Fixed readLine() getting stuck at the end of the file. --- source/mijin/io/stream.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/source/mijin/io/stream.cpp b/source/mijin/io/stream.cpp index cb74884..2124edb 100644 --- a/source/mijin/io/stream.cpp +++ b/source/mijin/io/stream.cpp @@ -240,7 +240,7 @@ StreamError Stream::readLine(std::string& outString) outString.clear(); bool done = false; - while(!done) + while (!done) { // read into the buffer std::size_t bytesRead = 0; @@ -270,6 +270,11 @@ StreamError Stream::readLine(std::string& outString) { return error; } + + if (isAtEnd()) + { + done = true; + } } return StreamError::SUCCESS;