aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/reader.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/reader.c b/src/reader.c
index afaf411e..9e30f9c1 100644
--- a/src/reader.c
+++ b/src/reader.c
@@ -1669,11 +1669,25 @@ read_statement(SerdReader* reader)
return ret;
}
+static void
+skip_until(SerdReader* reader, uint8_t byte)
+{
+ for (uint8_t c = 0; (c = peek_byte(reader)) && c != byte;) {
+ eat_byte_safe(reader, c);
+ }
+}
+
static bool
read_turtleTrigDoc(SerdReader* reader)
{
while (!reader->eof) {
- TRY_RET(read_statement(reader));
+ if (!read_statement(reader)) {
+ if (reader->strict) {
+ return 0;
+ }
+ skip_until(reader, '\n');
+ reader->status = SERD_ERR_BAD_SYNTAX;
+ }
}
return reader->status <= SERD_FAILURE;
}