aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--NEWS3
-rw-r--r--src/reader.c6
-rw-r--r--tests/bad/bad-missing-semi.ttl3
3 files changed, 11 insertions, 1 deletions
diff --git a/NEWS b/NEWS
index 0b22d3e0..1fb089e2 100644
--- a/NEWS
+++ b/NEWS
@@ -3,12 +3,13 @@ serd (0.23.0) unstable;
* Add serd_node_new_relative_uri()
* Fix construction and comparison of URIs with UTF-8 characters
* Report I/O errors with message and return appropriate status code
+ * Report missing statement separator errors
* Fix potential out of bounds read
* Fix unaligned memory access, undefined behaviour which breaks on ARM
* Fix documentation generation
* Update serdi man page
- -- David Robillard <d@drobilla.net> Sun, 10 Jul 2016 18:55:37 -0400
+ -- David Robillard <d@drobilla.net> Tue, 09 Aug 2016 16:54:23 -0400
serd (0.22.0) stable;
diff --git a/src/reader.c b/src/reader.c
index 59e0dd2e..0cfa1575 100644
--- a/src/reader.c
+++ b/src/reader.c
@@ -1245,6 +1245,7 @@ read_predicateObjectList(SerdReader* reader, ReadContext ctx, bool* ate_dot)
return true;
}
+ bool ate_semi = false;
do {
read_ws_star(reader);
switch (c = peek_byte(reader)) {
@@ -1254,8 +1255,13 @@ read_predicateObjectList(SerdReader* reader, ReadContext ctx, bool* ate_dot)
return true;
case ';':
eat_byte_safe(reader, c);
+ ate_semi = true;
}
} while (c == ';');
+
+ if (!ate_semi) {
+ return r_err(reader, SERD_ERR_BAD_SYNTAX, "missing ';' or '.'\n");
+ }
}
pop_node(reader, ctx.predicate);
diff --git a/tests/bad/bad-missing-semi.ttl b/tests/bad/bad-missing-semi.ttl
new file mode 100644
index 00000000..f8838805
--- /dev/null
+++ b/tests/bad/bad-missing-semi.ttl
@@ -0,0 +1,3 @@
+@prefix a: <http://example.org/> .
+a:s1 a:p1 a:o1
+a:s2 a:p2 a:o2 .