aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2017-09-23 15:39:18 +0200
committerDavid Robillard <d@drobilla.net>2017-09-23 15:59:23 +0200
commit45c7e97d70720d09653e421c870f607f8a67e747 (patch)
tree5b0ab42429963c432bb580952522eb41686e5de5 /src
parent162de28330285eb1f17b930c4c92d9e7fd89b3bb (diff)
downloadserd-45c7e97d70720d09653e421c870f607f8a67e747.tar.gz
serd-45c7e97d70720d09653e421c870f607f8a67e747.tar.bz2
serd-45c7e97d70720d09653e421c870f607f8a67e747.zip
Report errors when lax parsing
Diffstat (limited to 'src')
-rw-r--r--src/reader.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/reader.c b/src/reader.c
index 73821584..d74a6fc3 100644
--- a/src/reader.c
+++ b/src/reader.c
@@ -642,10 +642,12 @@ read_PN_CHARS_BASE(SerdReader* reader, Ref dest)
} else if ((st = read_utf8_code(reader, dest, &code,
eat_byte_safe(reader, c)))) {
return st;
- } else if (reader->strict && !is_PN_CHARS_BASE(code)) {
+ } else if (!is_PN_CHARS_BASE(code)) {
r_err(reader, SERD_ERR_BAD_SYNTAX,
"invalid character U+%04X in name\n", code);
- return SERD_ERR_BAD_SYNTAX;
+ if (reader->strict) {
+ return SERD_ERR_BAD_SYNTAX;
+ }
}
return st;
}
@@ -670,7 +672,7 @@ read_PN_CHARS(SerdReader* reader, Ref dest)
} else if ((st = read_utf8_code(reader, dest, &code,
eat_byte_safe(reader, c)))) {
return st;
- } else if (reader->strict && !is_PN_CHARS(code)) {
+ } else if (!is_PN_CHARS(code)) {
r_err(reader, (st = SERD_ERR_BAD_SYNTAX),
"invalid character U+%04X in name\n", code);
}