aboutsummaryrefslogtreecommitdiffstats
path: root/src/n3.c
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2024-03-29 06:55:05 -0400
committerDavid Robillard <d@drobilla.net>2024-03-29 08:39:49 -0400
commit9facb914c72bf4d0473b49faa797cdb5c9faf68b (patch)
treeb4fe7ec1d0c285cde99cf0a9456539fcb4d719e2 /src/n3.c
parentdc3aeed6ce84736100d713cac8f40e46d16d1289 (diff)
downloadserd-9facb914c72bf4d0473b49faa797cdb5c9faf68b.tar.gz
serd-9facb914c72bf4d0473b49faa797cdb5c9faf68b.tar.bz2
serd-9facb914c72bf4d0473b49faa797cdb5c9faf68b.zip
Fix lax NQuads parsing
Diffstat (limited to 'src/n3.c')
-rw-r--r--src/n3.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/n3.c b/src/n3.c
index da3862db..6684fae8 100644
--- a/src/n3.c
+++ b/src/n3.c
@@ -1783,13 +1783,17 @@ read_nquads_statement(SerdReader* const reader)
SerdStatus
read_nquadsDoc(SerdReader* const reader)
{
- SerdStatus st = SERD_SUCCESS;
-
- while (!reader->source.eof && !st) {
- st = read_nquads_statement(reader);
+ while (!reader->source.eof) {
+ const SerdStatus st = read_nquads_statement(reader);
+ if (st > SERD_FAILURE) {
+ if (reader->strict) {
+ return st;
+ }
+ serd_reader_skip_until_byte(reader, '\n');
+ }
}
- return st;
+ return SERD_SUCCESS;
}
#if defined(__clang__) && __clang_major__ >= 10