From 29d245328823b303047e45e11f82fb1513b5638d Mon Sep 17 00:00:00 2001 From: Aryadev Chavali Date: Fri, 29 Aug 2025 08:28:32 +0100 Subject: Cleaned up bugs with stream implementation Principle was that we may have read all the content from the underlying pipe (s.t. it set the EoF flag) but we haven't actually iterated the content. --- stream.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'stream.c') diff --git a/stream.c b/stream.c index a7fb72e..5013e3f 100644 --- a/stream.c +++ b/stream.c @@ -142,7 +142,9 @@ char stream_next(stream_t *stream) char stream_peek(stream_t *stream) { - if (stream_eos(stream)) + // If we've reached end of stream, and end of content, there's really nothing + // to check here. + if (stream_eoc(stream) && stream_eos(stream)) return '\0'; switch (stream->type) -- cgit v1.2.3-13-gbd6f