aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2019-02-24 09:35:10 +0100
committerDavid Robillard <d@drobilla.net>2020-10-27 13:13:58 +0100
commit2aca9f4bfbf8b32545c70b91ede7c5123ef67121 (patch)
tree3bd99cb695712582780dc6a4afadd4cb4d7e9e34
parent1997ab63fb66a55341de0311e1b309419a32d724 (diff)
downloadserd-2aca9f4bfbf8b32545c70b91ede7c5123ef67121.tar.gz
serd-2aca9f4bfbf8b32545c70b91ede7c5123ef67121.tar.bz2
serd-2aca9f4bfbf8b32545c70b91ede7c5123ef67121.zip
Make reader tolerant of being started several times
-rw-r--r--src/reader.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/reader.c b/src/reader.c
index d4c516eb..2a021e83 100644
--- a/src/reader.c
+++ b/src/reader.c
@@ -238,6 +238,7 @@ serd_reader_start_stream(SerdReader* reader,
const SerdNode* name,
size_t page_size)
{
+ serd_reader_finish(reader);
return serd_byte_source_open_source(
&reader->source, read_func, error_func, NULL, stream, name, page_size);
}
@@ -245,6 +246,8 @@ serd_reader_start_stream(SerdReader* reader,
SerdStatus
serd_reader_start_file(SerdReader* reader, const char* uri, bool bulk)
{
+ serd_reader_finish(reader);
+
char* const path = serd_file_uri_parse(uri, NULL);
if (!path) {
return SERD_ERR_BAD_ARG;
@@ -274,6 +277,7 @@ serd_reader_start_string(SerdReader* reader,
const char* utf8,
const SerdNode* name)
{
+ serd_reader_finish(reader);
return serd_byte_source_open_string(&reader->source, utf8, name);
}