aboutsummaryrefslogtreecommitdiff
path: root/stream.c
diff options
context:
space:
mode:
authorAryadev Chavali <aryadev@aryadevchavali.com>2025-08-29 08:28:32 +0100
committerAryadev Chavali <aryadev@aryadevchavali.com>2025-08-29 08:28:32 +0100
commit29d245328823b303047e45e11f82fb1513b5638d (patch)
tree8b9cf5548a00988ab5e6351e5ba619100ca42efc /stream.c
parentcc56a2ee2b5703f9ea5ac63a86870af188845c30 (diff)
downloadalisp-29d245328823b303047e45e11f82fb1513b5638d.tar.gz
alisp-29d245328823b303047e45e11f82fb1513b5638d.tar.bz2
alisp-29d245328823b303047e45e11f82fb1513b5638d.zip
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.
Diffstat (limited to 'stream.c')
-rw-r--r--stream.c4
1 files changed, 3 insertions, 1 deletions
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)