diff options
author | David Robillard <d@drobilla.net> | 2015-02-08 05:22:10 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2015-02-08 05:22:10 +0000 |
commit | 765929f0b2194171c7f793dc01e227830533c420 (patch) | |
tree | 6d8fe729162338b4c5bd8aad2179759cae0e935b /src | |
parent | 3257b52a2ceb7d6ad36a8cd8768612ce33090003 (diff) | |
download | lilv-765929f0b2194171c7f793dc01e227830533c420.tar.gz lilv-765929f0b2194171c7f793dc01e227830533c420.tar.bz2 lilv-765929f0b2194171c7f793dc01e227830533c420.zip |
Preserve absolute paths in state if no link directory is given.
git-svn-id: http://svn.drobilla.net/lad/trunk/lilv@5540 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src')
-rw-r--r-- | src/state.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/state.c b/src/state.c index 7968493..03ad488 100644 --- a/src/state.c +++ b/src/state.c @@ -216,7 +216,7 @@ abstract_path(LV2_State_Map_Path_Handle handle, free(real_path); return lilv_strdup(pm->rel); } else if (lilv_path_is_child(real_path, state->dir)) { - // File in state directory (loaded, or created by plugin during save + // File in state directory (loaded, or created by plugin during save) path = lilv_path_relative_to(real_path, state->dir); } else if (lilv_path_is_child(real_path, state->file_dir)) { // File created by plugin earlier @@ -238,13 +238,16 @@ abstract_path(LV2_State_Map_Path_Handle handle, // Refer to the latest copy in plugin state real_path = copy; } - } else { - // New path outside state directory + } 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; // Find a free name in the (virtual) state directory path = lilv_find_free_path(name, lilv_state_has_path, state); + } else { + // No link directory, preserve absolute path + path = lilv_strdup(abs_path); } // Add record to path mapping |