aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2011-05-12 01:04:30 +0000
committerDavid Robillard <d@drobilla.net>2011-05-12 01:04:30 +0000
commitb31927de2dfae882f6c77de1efd18136b15794c3 (patch)
tree2238672cea3d2e6393dd97bae4ee0a488401a6d0
parent9e9d85e3233a75b6a7ec00e306ba25f494af3013 (diff)
downloadserd-b31927de2dfae882f6c77de1efd18136b15794c3.tar.gz
serd-b31927de2dfae882f6c77de1efd18136b15794c3.tar.bz2
serd-b31927de2dfae882f6c77de1efd18136b15794c3.zip
Print newline after @prefix statements.
git-svn-id: http://svn.drobilla.net/serd/trunk@171 490d8e77-9747-427b-9fa3-0b8f29cee8a0
-rw-r--r--src/writer.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/writer.c b/src/writer.c
index 56dedd57..e9c3753d 100644
--- a/src/writer.c
+++ b/src/writer.c
@@ -45,6 +45,7 @@ struct SerdWriterImpl {
void* stream;
WriteContext context;
unsigned indent;
+ bool empty;
};
typedef enum {
@@ -178,6 +179,7 @@ reset_context(SerdWriter* writer)
if (writer->context.object.buf)
serd_node_free(&writer->context.object);
writer->context = WRITE_CONTEXT_NULL;
+ writer->empty = false;
}
static bool
@@ -357,6 +359,8 @@ serd_writer_write_statement(SerdWriter* writer,
serd_writer_write_delim(writer, '.');
serd_writer_write_delim(writer, '\n');
}
+ } else if (!writer->empty) {
+ serd_writer_write_delim(writer, '\n');
}
if (subject->type == SERD_ANON_BEGIN) {
@@ -449,6 +453,7 @@ serd_writer_new(SerdSyntax syntax,
writer->stream = stream;
writer->context = context;
writer->indent = 0;
+ writer->empty = true;
return writer;
}