aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2021-04-09 15:41:36 -0400
committerDavid Robillard <d@drobilla.net>2021-04-09 16:15:00 -0400
commita627bf523eba114b0e2466c77bd379d17c7195c6 (patch)
treec0951958a93da739005ffab2ab5b216cb5eef8ec /src
parent36f1cecc1fdb803bf04d2ab60bd13dd257a9e525 (diff)
downloadserd-a627bf523eba114b0e2466c77bd379d17c7195c6.tar.gz
serd-a627bf523eba114b0e2466c77bd379d17c7195c6.tar.bz2
serd-a627bf523eba114b0e2466c77bd379d17c7195c6.zip
Write statements with invalid URI characters in lax mode
Diffstat (limited to 'src')
-rw-r--r--src/n3.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/n3.c b/src/n3.c
index 9aae8a19..9e9d5327 100644
--- a/src/n3.c
+++ b/src/n3.c
@@ -723,7 +723,7 @@ read_IRIREF(SerdReader* reader, Ref* dest)
SerdStatus st = SERD_SUCCESS;
uint32_t code = 0;
- while (!st) {
+ while (st <= SERD_FAILURE) {
const int c = eat_byte_safe(reader, peek_byte(reader));
switch (c) {
case '"':
@@ -767,16 +767,16 @@ read_IRIREF(SerdReader* reader, Ref* dest)
default:
if (c <= 0x20) {
- r_err(reader,
- SERD_ERR_BAD_SYNTAX,
- "invalid IRI character (escape %%%02X)\n",
- (unsigned)c);
+ st = r_err(reader,
+ SERD_ERR_BAD_SYNTAX,
+ "invalid IRI character (escape %%%02X)\n",
+ (unsigned)c);
if (reader->strict) {
- *dest = pop_node(reader, *dest);
- return SERD_ERR_BAD_SYNTAX;
+ break;
+ } else {
+ st = SERD_FAILURE;
+ push_byte(reader, *dest, c);
}
- st = SERD_FAILURE;
- push_byte(reader, *dest, c);
} else if (!(c & 0x80)) {
push_byte(reader, *dest, c);
} else if (read_utf8_character(reader, *dest, (uint8_t)c)) {