diff options
Diffstat (limited to 'src/state.c')
-rw-r--r-- | src/state.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/state.c b/src/state.c index 8442949..63b26e6 100644 --- a/src/state.c +++ b/src/state.c @@ -752,14 +752,15 @@ lilv_state_new_from_file(LilvWorld* world, (subject) ? subject->node : sord_node_from_serd_node(world->world, env, &node, NULL, NULL); - char* dirname = lilv_path_parent(path); - char* real_path = zix_canonical_path(NULL, dirname); - char* dir_path = zix_path_join(NULL, real_path, NULL); - LilvState* state = + const ZixStringView dirname = zix_path_parent_path(path); + char* const real_path = zix_canonical_path(NULL, dirname.data); + char* const dir_path = zix_path_join(NULL, real_path, NULL); + + LilvState* const state = new_state_from_model(world, map, model, subject_node, dir_path); + zix_free(NULL, dir_path); zix_free(NULL, real_path); - free(dirname); serd_node_free(&node); zix_free(NULL, abs_path); |