summaryrefslogtreecommitdiffstats
path: root/src/state.c
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2022-11-12 17:54:34 -0500
committerDavid Robillard <d@drobilla.net>2022-11-16 10:22:55 -0500
commitd9feb39a41cf3d0dfc4c797f1a7aee99d8609c16 (patch)
tree86a9f1bdd51c8b5fd5e8e27506ef167a179b6fb5 /src/state.c
parentde60d222d9b1ff7931b74ded75cd8e31d77d9bd9 (diff)
downloadlilv-d9feb39a41cf3d0dfc4c797f1a7aee99d8609c16.tar.gz
lilv-d9feb39a41cf3d0dfc4c797f1a7aee99d8609c16.tar.bz2
lilv-d9feb39a41cf3d0dfc4c797f1a7aee99d8609c16.zip
Use zix_path_parent_path()
Diffstat (limited to 'src/state.c')
-rw-r--r--src/state.c11
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);