diff options
author | David Robillard <d@drobilla.net> | 2020-12-18 17:26:36 +0100 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2020-12-18 17:39:13 +0100 |
commit | e9bce3d4b0cf4cb95c6e3aaa7fe571be1151cd74 (patch) | |
tree | 209305ae3d3b7c255a926d0a223473094f78a0d6 /src | |
parent | a3f425d6d2f70d31f614187453e47252bce9fc7e (diff) | |
download | lilv-e9bce3d4b0cf4cb95c6e3aaa7fe571be1151cd74.tar.gz lilv-e9bce3d4b0cf4cb95c6e3aaa7fe571be1151cd74.tar.bz2 lilv-e9bce3d4b0cf4cb95c6e3aaa7fe571be1151cd74.zip |
Make symlink targets relative when they share a common parent
This might not be the right thing in every case, but it's the best we can do
without API to specifically configure this sort of thing (like setting a
project root) which doesn't currently exist.
Diffstat (limited to 'src')
-rw-r--r-- | src/filesystem.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/filesystem.c b/src/filesystem.c index bed9f81..b674113 100644 --- a/src/filesystem.c +++ b/src/filesystem.c @@ -351,7 +351,11 @@ lilv_symlink(const char* oldpath, const char* newpath) #ifdef _WIN32 ret = !CreateHardLink(newpath, oldpath, 0); #else - ret = symlink(oldpath, newpath); + char* target = lilv_path_relative_to(oldpath, newpath); + + ret = symlink(target, newpath); + + free(target); #endif } return ret; |