/*
Copyright (C) 2003, 2010 - Wolfire Games
-Copyright (C) 2010-2016 - Lugaru contributors (see AUTHORS file)
+Copyright (C) 2010-2017 - Lugaru contributors (see AUTHORS file)
This file is part of Lugaru.
const char* Folders::getHomeDirectory()
{
const char* homedir = getenv("HOME");
- if (homedir != NULL)
+ if (homedir != NULL) {
return homedir;
+ }
struct passwd* pw = getpwuid(getuid());
- if (pw != NULL)
+ if (pw != NULL) {
return pw->pw_dir;
+ }
return NULL;
}
#endif