summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/pluginlist.c20
1 files changed, 12 insertions, 8 deletions
diff --git a/src/pluginlist.c b/src/pluginlist.c
index cd83629..e379c7a 100644
--- a/src/pluginlist.c
+++ b/src/pluginlist.c
@@ -55,16 +55,20 @@ slv2_list_load_all(SLV2List list)
{
assert(list != NULL);
- char* slv2_path = getenv("LV2_PATH");
-
- if (!slv2_path) {
- slv2_path = "~/.lv2:/usr/local/lib/lv2:usr/lib/lv2";
+ const char* slv2_path = getenv("LV2_PATH");
+
+ if (slv2_path) {
+ slv2_list_load_path(list, slv2_path);
+ } else {
+ const char* const home = getenv("HOME");
+ const char* const suffix = "/.lv2:/usr/local/lib/lv2:usr/lib/lv2";
+ slv2_path = strjoin(home, suffix);
- printf("$LV2_PATH is unset. Using default path %s\n",
- slv2_path);
- }
+ printf("$LV2_PATH is unset. Using default path %s\n", slv2_path);
+ slv2_list_load_path(list, slv2_path);
- slv2_list_load_path(list, slv2_path);
+ free(slv2_path);
+ }
}