summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2007-06-21 22:09:40 +0000
committerDavid Robillard <d@drobilla.net>2007-06-21 22:09:40 +0000
commitf323c56e8bf061741fa32e10c610e21aed622923 (patch)
tree9bace01325ae2e49aaeacf92dcea70cf88bbebe4 /src
parentfc0be457290980cee9de72e7ae623a7e88ca17b6 (diff)
downloadlilv-f323c56e8bf061741fa32e10c610e21aed622923.tar.gz
lilv-f323c56e8bf061741fa32e10c610e21aed622923.tar.bz2
lilv-f323c56e8bf061741fa32e10c610e21aed622923.zip
Fix crash when HOME env variable isn't set.
git-svn-id: http://svn.drobilla.net/lad/slv2@539 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src')
-rw-r--r--src/world.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/world.c b/src/world.c
index 11c5c2e..57bea81 100644
--- a/src/world.c
+++ b/src/world.c
@@ -324,8 +324,12 @@ slv2_world_load_all(SLV2World world)
slv2_world_load_path(world, lv2_path);
} else {
const char* const home = getenv("HOME");
- const char* const suffix = "/.lv2:/usr/local/lib/lv2:/usr/lib/lv2";
- lv2_path = slv2_strjoin(home, suffix, NULL);
+ if (home) {
+ const char* const suffix = "/.lv2:/usr/local/lib/lv2:/usr/lib/lv2";
+ lv2_path = slv2_strjoin(home, suffix, NULL);
+ } else {
+ lv2_path = strdup("/usr/local/lib/lv2:/usr/lib/lv2");
+ }
slv2_world_load_path(world, lv2_path);