From d3b2131441d2846a1d123defc2493a6fcf996cff Mon Sep 17 00:00:00 2001 From: rncbc Date: Wed, 5 Jun 2024 10:16:53 +0100 Subject: Fix parent path in lilv_state_new_from_file() See also: https://www.rncbc.org/drupal/comment/10648#comment-10648 https://tracker.ardour.org/view.php?id=9717 --- src/state.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/state.c b/src/state.c index 0ed5715..ddede30 100644 --- a/src/state.c +++ b/src/state.c @@ -781,15 +781,16 @@ lilv_state_new_from_file(LilvWorld* world, (subject) ? subject->node : sord_node_from_serd_node(world->world, env, &node, NULL, NULL); - 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); + char* const dirname = zix_string_view_copy(NULL, zix_path_parent_path(path)); + char* const real_path = zix_canonical_path(NULL, dirname); + 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); + zix_free(NULL, dirname); serd_node_free(&node); zix_free(NULL, abs_path); -- cgit v1.2.1