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