diff options
author | David Robillard <d@drobilla.net> | 2021-04-09 15:41:36 -0400 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2021-04-09 16:15:00 -0400 |
commit | a627bf523eba114b0e2466c77bd379d17c7195c6 (patch) | |
tree | c0951958a93da739005ffab2ab5b216cb5eef8ec /src/n3.c | |
parent | 36f1cecc1fdb803bf04d2ab60bd13dd257a9e525 (diff) | |
download | serd-a627bf523eba114b0e2466c77bd379d17c7195c6.tar.gz serd-a627bf523eba114b0e2466c77bd379d17c7195c6.tar.bz2 serd-a627bf523eba114b0e2466c77bd379d17c7195c6.zip |
Write statements with invalid URI characters in lax mode
Diffstat (limited to 'src/n3.c')
-rw-r--r-- | src/n3.c | 18 |
1 files changed, 9 insertions, 9 deletions
@@ -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)) { |