summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2006-07-26 17:46:54 +0000
committerDavid Robillard <d@drobilla.net>2006-07-26 17:46:54 +0000
commita9d4bccde03dd6d29338366bf6900b7094e63ad4 (patch)
tree3948b6076ec47406bd2fcafae294806e939bb2b3
parent2cd84e4209633e59439c445f821bed8410347bab (diff)
downloadlilv-a9d4bccde03dd6d29338366bf6900b7094e63ad4.tar.gz
lilv-a9d4bccde03dd6d29338366bf6900b7094e63ad4.tar.bz2
lilv-a9d4bccde03dd6d29338366bf6900b7094e63ad4.zip
Use getenv("HOME") instead of hardcoded "~"
git-svn-id: http://svn.drobilla.net/lad/libslv2@102 a436a847-0d15-0410-975c-d299462d15a1
-rw-r--r--TODO4
-rw-r--r--src/pluginlist.c20
2 files changed, 16 insertions, 8 deletions
diff --git a/TODO b/TODO
new file mode 100644
index 0000000..38e4834
--- /dev/null
+++ b/TODO
@@ -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)
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);
+ }
}