Browse Source

Backport serd double backslash encoding fix

Signed-off-by: falkTX <falktx@falktx.com>
pull/1841/head
falkTX 11 months ago
parent
commit
bcfcafd2ad
Signed by: falkTX <falktx@falktx.com> GPG Key ID: CDBAA37ABC74FBA0
1 changed files with 13 additions and 3 deletions
  1. +13
    -3
      source/modules/lilv/serd-0.24.0/src/reader.c

+ 13
- 3
source/modules/lilv/serd-0.24.0/src/reader.c View File

@@ -554,9 +554,19 @@ read_STRING_LITERAL_LONG(SerdReader* reader, SerdNodeFlags* flags, uint8_t q)
eat_byte_safe(reader, q3);
return ref;
} else {
*flags |= SERD_HAS_QUOTE;
push_byte(reader, ref, c);
read_character(reader, ref, flags, q2);
if (q2 == '\\') {
push_byte(reader, ref, c);
if (!read_ECHAR(reader, ref, flags) &&
!read_UCHAR(reader, ref, &code)) {
r_err(reader, SERD_ERR_BAD_SYNTAX,
"invalid escape `\\%c'\n", peek_byte(reader));
return pop_node(reader, ref);
}
} else {
*flags |= SERD_HAS_QUOTE;
push_byte(reader, ref, c);
read_character(reader, ref, flags, q2);
}
}
} else {
read_character(reader, ref, flags, eat_byte_safe(reader, c));


Loading…
Cancel
Save