diff options
author | David Robillard <d@drobilla.net> | 2018-05-13 00:48:31 +0200 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2018-05-27 21:10:21 +0200 |
commit | 52d0ac81eee3462c6839c7374ffe57329f7702b7 (patch) | |
tree | e40ed9149fb64122f8e4bc349639762baed11c3f /src/n3.c | |
parent | 48a9091b17435512f85d9ff202a5a7ea46c6af2a (diff) | |
download | serd-52d0ac81eee3462c6839c7374ffe57329f7702b7.tar.gz serd-52d0ac81eee3462c6839c7374ffe57329f7702b7.tar.bz2 serd-52d0ac81eee3462c6839c7374ffe57329f7702b7.zip |
Zero node padding before passing to reader sinks
Diffstat (limited to 'src/n3.c')
-rw-r--r-- | src/n3.c | 9 |
1 files changed, 6 insertions, 3 deletions
@@ -1050,10 +1050,10 @@ read_object(SerdReader* reader, ReadContext* ctx, bool emit, bool* ate_dot) o->flags = flags; } - if (ret && emit && simple) { + if (ret && emit && simple && o) { ret = emit_statement(reader, *ctx, o); } else if (ret && !emit) { - ctx->object = o; + ctx->object = o; return true; } @@ -1261,6 +1261,7 @@ read_base(SerdReader* reader, bool sparql, bool token) if (!uri) { return false; } else if (reader->sink->base) { + serd_node_zero_pad(uri); reader->sink->base(reader->sink->handle, uri); } @@ -1295,12 +1296,14 @@ read_prefixID(SerdReader* reader, bool sparql, bool token) } read_ws_star(reader); - const SerdNode* uri = read_IRIREF(reader); + SerdNode* uri = read_IRIREF(reader); if (!uri) { return false; } if (reader->sink->prefix) { + serd_node_zero_pad(name); + serd_node_zero_pad(uri); ret = !reader->sink->prefix(reader->sink->handle, name, uri); } if (!sparql) { |