aboutsummaryrefslogtreecommitdiffstats
path: root/src/byte_source.c
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2017-11-05 12:06:19 +0100
committerDavid Robillard <d@drobilla.net>2017-11-05 12:06:19 +0100
commit07e6a2e7d182483552b940ecdb27231d7983fd19 (patch)
treeca1cd400d13a9eaec24d9cb76725675190691cbf /src/byte_source.c
parent8aad54ea550d0d923189834f964512a9b1be927f (diff)
downloadserd-07e6a2e7d182483552b940ecdb27231d7983fd19.tar.gz
serd-07e6a2e7d182483552b940ecdb27231d7983fd19.tar.bz2
serd-07e6a2e7d182483552b940ecdb27231d7983fd19.zip
Move EOF flag from reader to byte source
Diffstat (limited to 'src/byte_source.c')
-rw-r--r--src/byte_source.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/byte_source.c b/src/byte_source.c
index 588d258e..8346785f 100644
--- a/src/byte_source.c
+++ b/src/byte_source.c
@@ -24,6 +24,7 @@ serd_byte_source_page(SerdByteSource* source)
source->file_buf, 1, source->page_size, source->stream);
if (n_read == 0) {
source->file_buf[0] = '\0';
+ source->eof = true;
return (source->error_func(source->stream)
? SERD_ERR_UNKNOWN : SERD_FAILURE);
} else if (n_read < source->page_size) {
@@ -61,6 +62,7 @@ SerdStatus
serd_byte_source_prepare(SerdByteSource* source)
{
if (!source->prepared) {
+ source->eof = false;
source->prepared = true;
if (source->page_size > 1) {
return serd_byte_source_page(source);