From 0b7f54a7a07b55538038351778ac7fcc6c75db0f Mon Sep 17 00:00:00 2001 From: David Robillard Date: Tue, 3 Jan 2017 15:51:55 -0500 Subject: Always escape file URIs --- src/state.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/state.c') diff --git a/src/state.c b/src/state.c index 4781405..aef7733 100644 --- a/src/state.c +++ b/src/state.c @@ -643,7 +643,7 @@ lilv_state_new_from_file(LilvWorld* world, } uint8_t* abs_path = (uint8_t*)lilv_path_absolute(path); - SerdNode node = serd_node_new_file_uri(abs_path, NULL, NULL, 0); + SerdNode node = serd_node_new_file_uri(abs_path, NULL, NULL, true); SerdEnv* env = serd_env_new(&node); SordModel* model = sord_new(world->world, SORD_SPO, false); SerdReader* reader = sord_new_reader(model, env, SERD_TURTLE, NULL); @@ -796,8 +796,8 @@ add_state_to_manifest(LilvWorld* lworld, const char* state_path) { SordWorld* world = lworld->world; - SerdNode manifest = serd_node_new_file_uri(USTR(manifest_path), 0, 0, 0); - SerdNode file = serd_node_new_file_uri(USTR(state_path), 0, 0, 0); + SerdNode manifest = serd_node_new_file_uri(USTR(manifest_path), 0, 0, 1); + SerdNode file = serd_node_new_file_uri(USTR(state_path), 0, 0, 1); SerdEnv* env = serd_env_new(&manifest); SordModel* model = sord_new(world, SORD_SPO, false); @@ -1081,7 +1081,7 @@ lilv_state_save(LilvWorld* world, lilv_state_make_links(state, abs_dir); // Write state to Turtle file - SerdNode file = serd_node_new_file_uri(USTR(path), NULL, NULL, false); + SerdNode file = serd_node_new_file_uri(USTR(path), NULL, NULL, true); SerdNode node = uri ? serd_node_from_string(SERD_URI, USTR(uri)) : file; SerdEnv* env = NULL; SerdWriter* ttl = ttl_file_writer(fd, &file, &env); @@ -1089,7 +1089,7 @@ lilv_state_save(LilvWorld* world, world, map, unmap, state, ttl, (const char*)node.buf, dir); // Set saved dir and uri (FIXME: const violation) - SerdNode dir_uri = serd_node_new_file_uri(USTR(abs_dir), NULL, NULL, false); + SerdNode dir_uri = serd_node_new_file_uri(USTR(abs_dir), NULL, NULL, true); free(state->dir); lilv_node_free(state->uri); ((LilvState*)state)->dir = (char*)dir_uri.buf; -- cgit v1.2.1