From 52dc5234ce4da1427883dfdda70b9f07bc775994 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sun, 24 Feb 2019 09:35:10 +0100 Subject: Make reader tolerant of being started several times --- src/reader.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/reader.c b/src/reader.c index 5daec8f8..44b17704 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_parse_file_uri(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); } -- cgit v1.2.1