stream: fix bug with stream_next; return the next character

It seems we'd return the previously peeked character when
stream_next'ing, when really we should be sending the updated
character.
This commit is contained in:
2026-02-05 04:29:07 +00:00
parent 10d6876de4
commit e7d3bca4d7

View File

@@ -192,10 +192,9 @@ bool stream_chunk(stream_t *stream)
char stream_next(stream_t *stream) char stream_next(stream_t *stream)
{ {
char c = stream_peek(stream); if (stream_peek(stream) != '\0')
if (c != '\0')
++stream->position; ++stream->position;
return c; return stream_peek(stream);
} }
char stream_peek(stream_t *stream) char stream_peek(stream_t *stream)