Commit d4638834 authored by Max Kellermann's avatar Max Kellermann

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.
parent db849d1e
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment