aboutsummaryrefslogtreecommitdiffstats
path: root/src/writer.c
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2011-12-15 21:59:29 +0000
committerDavid Robillard <d@drobilla.net>2011-12-15 21:59:29 +0000
commit28eead258c8d309e40401a9a05fe00e00a193ff4 (patch)
tree9357928b58cd841faa9212213965b3b13d2dd574 /src/writer.c
parent0ddb866a84866b1102968d7b55dc6702dca52e4a (diff)
downloadserd-28eead258c8d309e40401a9a05fe00e00a193ff4.tar.gz
serd-28eead258c8d309e40401a9a05fe00e00a193ff4.tar.bz2
serd-28eead258c8d309e40401a9a05fe00e00a193ff4.zip
Remove peek_string, use exactly 1 page as a read buffer.
git-svn-id: http://svn.drobilla.net/serd/trunk@256 490d8e77-9747-427b-9fa3-0b8f29cee8a0
Diffstat (limited to 'src/writer.c')
-rw-r--r--src/writer.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/writer.c b/src/writer.c
index d8fe039f..cee0455f 100644
--- a/src/writer.c
+++ b/src/writer.c
@@ -100,7 +100,7 @@ write_text(SerdWriter* writer, TextContext ctx,
// Fast bulk write for long strings of printable ASCII
size_t j = i;
for (; j < n_bytes; ++j) {
- if (utf8[j] == terminator || utf8[j] == '\\'
+ if (utf8[j] == terminator || utf8[j] == '\\' || utf8[j] == '"'
|| (((writer->style & SERD_STYLE_ASCII) || ctx == WRITE_URI)
&& !in_range(utf8[j], 0x20, 0x7E))) {
break;
@@ -117,6 +117,8 @@ write_text(SerdWriter* writer, TextContext ctx,
if (ctx == WRITE_LONG_STRING) {
if (in == '\\') {
sink("\\\\", 2, writer); continue;
+ } else if (in == '\"' && i == n_bytes) {
+ sink("\\\"", 2, writer); continue; // '"' at end of string
}
} else {
switch (in) {