Changeset 8510d5b


Ignore:
Timestamp:
Dec 21, 2010, 5:54:58 PM (11 years ago)
Author:
David Benjamin <davidben@mit.edu>
Branches:
master, release-1.8, release-1.9
Children:
f640876
Parents:
fa90c34
git-author:
David Benjamin <davidben@mit.edu> (12/15/10 15:05:57)
git-committer:
David Benjamin <davidben@mit.edu> (12/21/10 17:54:58)
Message:
Check passwd entries to determine home dir

Still manually check the HOME variable because g_get_home_dir prefers
passwd entries to environment variables. (Should we?)
File:
1 edited

Legend:

Unmodified
Added
Removed
  • global.c

    r2ec737f r8510d5b  
    1919  char hostname[MAXHOSTNAMELEN];
    2020  char *cd;
     21  const char *homedir;
    2122
    2223  g_type_init();
     
    8384
    8485  /* Fill in some variables which don't have constant defaults */
    85   /* TODO: come back later and check passwd file first */
    86   g->homedir=owl_strdup(getenv("HOME"));
     86
     87  /* glib's g_get_home_dir prefers passwd entries to $HOME, so we
     88   * explicitly check getenv first. */
     89  homedir = getenv("HOME");
     90  if (!homedir)
     91    homedir = g_get_home_dir();
     92  g->homedir = owl_strdup(homedir);
    8793
    8894  g->confdir = NULL;
Note: See TracChangeset for help on using the changeset viewer.