diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/serdi.c | 4 | ||||
-rw-r--r-- | src/writer.c | 8 |
2 files changed, 6 insertions, 6 deletions
diff --git a/src/serdi.c b/src/serdi.c index 59c66cae..0610069d 100644 --- a/src/serdi.c +++ b/src/serdi.c @@ -100,7 +100,7 @@ main(int argc, char** argv) SerdSyntax input_syntax = (SerdSyntax)0; SerdSyntax output_syntax = (SerdSyntax)0; - SerdWriterFlags writer_flags = SERD_WRITE_STRICT; + SerdWriterFlags writer_flags = 0; bool from_string = false; bool from_stdin = false; bool bulk_read = true; @@ -139,8 +139,8 @@ main(int argc, char** argv) } else if (opt == 'h') { return print_usage(prog, false); } else if (opt == 'l') { + writer_flags |= SERD_WRITE_LAX; lax = true; - writer_flags &= ~(SerdWriterFlags)SERD_WRITE_STRICT; } else if (opt == 'q') { quiet = true; } else if (opt == 't') { diff --git a/src/writer.c b/src/writer.c index 3079cebc..58fd0d53 100644 --- a/src/writer.c +++ b/src/writer.c @@ -364,7 +364,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; } @@ -387,7 +387,7 @@ ewrite_uri(SerdWriter* writer, const char* utf8, size_t n_bytes) SerdStatus st = SERD_SUCCESS; write_uri(writer, utf8, n_bytes, &st); - return (st == SERD_BAD_WRITE || (writer->flags & SERD_WRITE_STRICT)) + return (st == SERD_BAD_WRITE || !(writer->flags & SERD_WRITE_LAX)) ? st : SERD_SUCCESS; } @@ -553,7 +553,7 @@ write_text(SerdWriter* writer, // Write UTF-8 character size_t size = 0; write_character(writer, (const uint8_t*)utf8 + i - 1, &size, &st); - if (st && (writer->flags & SERD_WRITE_STRICT)) { + if (st && !(writer->flags & SERD_WRITE_LAX)) { return st; } @@ -567,7 +567,7 @@ write_text(SerdWriter* writer, } } - return (writer->flags & SERD_WRITE_STRICT) ? st : SERD_SUCCESS; + return (writer->flags & SERD_WRITE_LAX) ? SERD_SUCCESS : st; } typedef struct { |