forked from enlightenment/efl
eina utils: fix build without getpwent.
If HAVE_GETPWENT isn't defined - the closing brace was missed. Also prevent situation when strdup() tried to duplicate NULL pointer, because that could cause segfault. @fix
This commit is contained in:
parent
80e3c643d8
commit
94eaa792c2
|
@ -84,12 +84,14 @@ eina_environment_home_get(void)
|
|||
if (!getpwuid_r(geteuid(), &pwent, pwbuf, sizeof(pwbuf), &pwent2))
|
||||
{
|
||||
if ((pwent2) && (pwent.pw_dir))
|
||||
home = strdup(pwent.pw_dir);
|
||||
{
|
||||
home = strdup(pwent.pw_dir);
|
||||
return home;
|
||||
}
|
||||
}
|
||||
if (!home) home = strdup("/tmp");
|
||||
return home;
|
||||
}
|
||||
# endif
|
||||
home = "/tmp";
|
||||
}
|
||||
#endif
|
||||
home = strdup(home);
|
||||
return home;
|
||||
|
|
Loading…
Reference in New Issue