aboutsummaryrefslogtreecommitdiffstats
path: root/src/n3.c
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2023-02-28 19:39:35 -0500
committerDavid Robillard <d@drobilla.net>2023-03-31 11:10:52 -0400
commit002e2edc7fee5297b1bc8e1da4932d38e270f8f8 (patch)
treee701cf2bcf6663f3b7dd79234b6f3145e4e46f26 /src/n3.c
parent647179b76fe15e5306a5a4f7ebbc1ad933d5a526 (diff)
downloadserd-002e2edc7fee5297b1bc8e1da4932d38e270f8f8.tar.gz
serd-002e2edc7fee5297b1bc8e1da4932d38e270f8f8.tar.bz2
serd-002e2edc7fee5297b1bc8e1da4932d38e270f8f8.zip
Fix incorrect parsing of strange quote escape patterns
Diffstat (limited to 'src/n3.c')
-rw-r--r--src/n3.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/n3.c b/src/n3.c
index 71a2fc56..e14cb8ce 100644
--- a/src/n3.c
+++ b/src/n3.c
@@ -361,9 +361,15 @@ read_STRING_LITERAL_LONG(SerdReader* const reader,
skip_byte(reader, q3);
break;
}
- *flags |= SERD_HAS_QUOTE;
- push_byte(reader, ref, c);
- st = read_character(reader, ref, flags, (uint8_t)q2);
+
+ if (q2 == '\\') {
+ push_byte(reader, ref, c);
+ st = read_string_escape(reader, ref, flags);
+ } else {
+ *flags |= SERD_HAS_QUOTE;
+ push_byte(reader, ref, c);
+ st = read_character(reader, ref, flags, (uint8_t)q2);
+ }
} else if (c == EOF) {
return r_err(reader, SERD_ERR_BAD_SYNTAX, "end of file in long string\n");
} else {