From cbaeb002f88f433f320c4c33a130b61a5cecd0f0 Mon Sep 17 00:00:00 2001 From: Max Wash Date: Mon, 22 Sep 2025 10:32:37 +0100 Subject: [PATCH] core: stream: b_stream_read_line_s now includes linefeed in output and correctly reports EOF condition --- core/stream.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/core/stream.c b/core/stream.c index 87f3323..fa7ea46 100644 --- a/core/stream.c +++ b/core/stream.c @@ -386,14 +386,19 @@ enum b_status b_stream_read_line_s(struct b_stream *src, b_stream *dest) break; } + b_stream_write_char(dest, c); + i++; + if (c == '\n') { break; } - - b_stream_write_char(dest, c); } - return B_SUCCESS; + if (status == B_ERR_NO_DATA && i > 0) { + status = B_SUCCESS; + } + + return status; } enum b_status b_stream_read_all_bytes(