From f323c56e8bf061741fa32e10c610e21aed622923 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Thu, 21 Jun 2007 22:09:40 +0000 Subject: Fix crash when HOME env variable isn't set. git-svn-id: http://svn.drobilla.net/lad/slv2@539 a436a847-0d15-0410-975c-d299462d15a1 --- src/world.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src') 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); -- cgit v1.2.1