diff options
author | David Robillard <d@drobilla.net> | 2019-04-28 17:54:00 +0200 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2019-12-20 10:26:55 -0500 |
commit | 99ec121876753b95987a53f7435427fdf438191a (patch) | |
tree | 002df115e543da606c8c78f7d30739ac62fe8c69 /src/writer.c | |
parent | f79260e122a02b0cf553342d598bba78e169d0da (diff) | |
download | serd-99ec121876753b95987a53f7435427fdf438191a.tar.gz serd-99ec121876753b95987a53f7435427fdf438191a.tar.bz2 serd-99ec121876753b95987a53f7435427fdf438191a.zip |
Replace serd_reader_set_strict() with SerdReaderFlags
This makes reader options extensible and should hopefully prevent the need for
grafting on more similar functions in the future.
Diffstat (limited to 'src/writer.c')
-rw-r--r-- | src/writer.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/writer.c b/src/writer.c index d3ed1ae5..7c057107 100644 --- a/src/writer.c +++ b/src/writer.c @@ -281,7 +281,7 @@ write_uri(SerdWriter* writer, const char* utf8, size_t n_bytes, SerdStatus* st) size_t size = 0; len += write_character(writer, (const uint8_t*)utf8 + i, &size, st); i += size; - if (*st && (writer->flags & SERD_WRITE_STRICT)) { + if (*st && !(writer->flags & SERD_WRITE_LAX)) { break; } else if (size == 0) { // Corrupt input, scan to start of next character @@ -297,7 +297,7 @@ ewrite_uri(SerdWriter* writer, const char* utf8, size_t n_bytes) SerdStatus st = SERD_SUCCESS; write_uri(writer, utf8, n_bytes, &st); - return (writer->flags & SERD_WRITE_STRICT) ? st : SERD_SUCCESS; + return (writer->flags & SERD_WRITE_LAX) ? SERD_SUCCESS : st; } SERD_WARN_UNUSED_RESULT static SerdStatus @@ -423,7 +423,7 @@ write_text(SerdWriter* writer, } } - return (writer->flags & SERD_WRITE_STRICT) ? st : SERD_SUCCESS; + return (writer->flags & SERD_WRITE_LAX) ? SERD_SUCCESS : st; } SERD_WARN_UNUSED_RESULT static size_t |