utils: use g_get_home_dir()

Use g_get_home_dir() to get the home directory of the current user.
This will be portable to win32.
This commit is contained in:
Max Kellermann 2008-12-29 17:42:49 +01:00
parent db849d1eed
commit d4638834f8

View File

@ -134,14 +134,12 @@ char *parsePath(char *path)
home = passwd->pw_dir;
} else {
struct passwd *passwd = getpwuid(geteuid());
if (!passwd) {
g_warning("problems getting passwd "
"entry for current user");
home = g_get_home_dir();
if (home == NULL) {
g_warning("problems getting home "
"for current user");
return NULL;
}
home = passwd->pw_dir;
}
} else {
bool foundSlash = false;