From 840392eb0d7b7b81cc75955d113fe71d9684fda2 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Fri, 18 Dec 2020 17:05:57 +0100 Subject: Windows: Fix determining state filenames from backslashey paths --- src/state.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/state.c b/src/state.c index 57a5783..97709d3 100644 --- a/src/state.c +++ b/src/state.c @@ -307,11 +307,12 @@ abstract_path(LV2_State_Map_Path_Handle handle, } } else if (state->link_dir) { // New path outside state directory, make a link - const char* slash = strrchr(real_path, '/'); - const char* name = slash ? (slash + 1) : real_path; + char* const name = lilv_path_filename(real_path); // Find a free name in the (virtual) state directory path = lilv_find_free_path(name, lilv_state_has_path, state); + + free(name); } else { // No link directory, preserve absolute path path = lilv_strdup(abs_path); -- cgit v1.2.1