From d592cccffb7f4106c5e86376c861ccd22d8884a2 Mon Sep 17 00:00:00 2001 From: Andrea Mazzoleni Date: Mon, 17 Aug 2026 17:26:49 +0200 Subject: [PATCH] Set stream state to EOF in sfill when reaching stream size limit --- cmdline/stream.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cmdline/stream.c b/cmdline/stream.c index 8cd32d9b..1b56b9a8 100644 --- a/cmdline/stream.c +++ b/cmdline/stream.c @@ -231,8 +231,9 @@ static int sfill(STREAM* s) /* LCOV_EXCL_STOP */ } - /* if we reached the end, doesn't try to read */ + /* expose the logical size boundary as EOF, just like EOF from the underlying file */ if (s->offset >= s->size) { + s->state = STREAM_STATE_EOF; return EOF; }