summaryrefslogtreecommitdiff
path: root/navit/main.c
diff options
context:
space:
mode:
authormartin-s <martin-s@ffa7fe5e-494d-0410-b361-a75ebd5db220>2009-08-20 16:54:30 +0000
committermartin-s <martin-s@ffa7fe5e-494d-0410-b361-a75ebd5db220>2009-08-20 16:54:30 +0000
commit4564fac204e62d3420756bd47e54d41c6a15857e (patch)
tree8c3a572de5dbd3ef1539c3021ebe942a1f2ca428 /navit/main.c
parent423c79abc906914b8edd4be7614eccfb2696a866 (diff)
downloadnavit-4564fac204e62d3420756bd47e54d41c6a15857e.tar.gz
Fix:Core:Some cleanups in environment setup
git-svn-id: http://svn.code.sf.net/p/navit/code/trunk/navit@2498 ffa7fe5e-494d-0410-b361-a75ebd5db220
Diffstat (limited to 'navit/main.c')
-rw-r--r--navit/main.c25
1 files changed, 5 insertions, 20 deletions
diff --git a/navit/main.c b/navit/main.c
index 303fe7740..6e357a029 100644
--- a/navit/main.c
+++ b/navit/main.c
@@ -65,24 +65,6 @@ static void sigchld(int sig)
#endif
}
-#if 0
-static gchar *get_home_directory(void)
-{
- static gchar *homedir = NULL;
-
- if (homedir) return homedir;
- homedir = getenv("HOME");
- if (!homedir)
- {
- dbg(0,"Could not find home directory. Using current directory as home directory.\n");
- homedir =g_strdup(".");
- } else {
- homedir=g_strdup(homedir);
- }
- return homedir;
-}
-#endif
-
static GList *navit;
struct iter {
@@ -194,7 +176,7 @@ static void
main_setup_environment(int mode)
{
int i=0;
- char *var,*val;
+ char *var,*val,*homedir;
while ((var=environment_vars[i][0])) {
val=environment_vars[i][mode+1];
if (val) {
@@ -206,7 +188,10 @@ main_setup_environment(int mode)
val=g_strdup_printf("%s%s", getenv("NAVIT_PREFIX"), val+1);
break;
case '~':
- val=g_strdup_printf("%s%s", getenv("HOME"), val+1);
+ homedir=getenv("HOME");
+ if (!homedir)
+ homedir="./";
+ val=g_strdup_printf("%s%s", homedir, val+1);
break;
default:
val=g_strdup(val);