Use getenv("HOME") instead of hardcoded "~"

git-svn-id: http://svn.drobilla.net/lad@102 a436a847-0d15-0410-975c-d299462d15a1
This commit is contained in:
dave 2006-07-26 17:46:54 +00:00
parent b106330c47
commit a21e6fe4d7
2 changed files with 15 additions and 7 deletions

4
libslv2/TODO Normal file
View File

@ -0,0 +1,4 @@
- Rewrite all the realloc nightmare stuff
<remon> drobilla: slv2_port_get_default_value checks if a property is returned,and creates the result. But it calls slv2_property_free() even if the property == 0 !!
<remon> drobilla: (which causes a segfault)

View File

@ -55,16 +55,20 @@ slv2_list_load_all(SLV2List list)
{
assert(list != NULL);
char* slv2_path = getenv("LV2_PATH");
const char* slv2_path = getenv("LV2_PATH");
if (!slv2_path) {
slv2_path = "~/.lv2:/usr/local/lib/lv2:usr/lib/lv2";
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);
}
}