aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--NEWS7
-rw-r--r--src/reader.c11
2 files changed, 11 insertions, 7 deletions
diff --git a/NEWS b/NEWS
index b9bfe65b..da1690ff 100644
--- a/NEWS
+++ b/NEWS
@@ -1,11 +1,10 @@
-serd (0.29.2) unstable;
+serd (0.29.3) unstable;
* Support strict parsing of prefixed names
- * Report errors for directives or abbreviations in NTriples or NQuads
- * Report errors for prematurely terminated statements
+ * Report errors for all failing test cases
* Fix building with MSVC
- -- David Robillard <d@drobilla.net> Sat, 23 Sep 2017 13:54:10 +0200
+ -- David Robillard <d@drobilla.net> Sat, 23 Sep 2017 14:41:49 +0200
serd (0.28.0) stable;
diff --git a/src/reader.c b/src/reader.c
index bdfd23d3..73821584 100644
--- a/src/reader.c
+++ b/src/reader.c
@@ -1561,9 +1561,13 @@ read_wrappedGraph(SerdReader* reader, ReadContext* ctx)
while (peek_byte(reader) != '}') {
ctx->subject = 0;
Ref subj = read_subject(reader, *ctx, &ctx->subject, &s_type);
- if (!subj ||
- (!read_triples(reader, *ctx, &ate_dot) && s_type != '[')) {
+ if (!subj && ctx->subject) {
+ return r_err(reader, SERD_ERR_BAD_SYNTAX, "bad subject\n");
+ } else if (!subj) {
return false;
+ } else if (!read_triples(reader, *ctx, &ate_dot) && s_type != '[') {
+ return r_err(reader, SERD_ERR_BAD_SYNTAX,
+ "missing predicate object list\n");
}
pop_node(reader, subj);
read_ws_star(reader);
@@ -1637,7 +1641,8 @@ read_statement(SerdReader* reader)
read_ws_star(reader);
} else if (read_ws_star(reader) && peek_byte(reader) == '{') {
if (s_type == '(' || (s_type == '[' && !*ctx.flags)) {
- return false; // invalid graph with complex label
+ return r_err(reader, SERD_ERR_BAD_SYNTAX,
+ "invalid graph name\n");
}
ctx.graph = subj;
ctx.subject = subj = 0;