|
|
@ -27,7 +27,7 @@ |
|
|
|
|
|
|
|
#if defined(_WIN32) |
|
|
|
#include <shlobj.h> |
|
|
|
#elif defined(__APPLE__) |
|
|
|
#else |
|
|
|
#include <stdlib.h> |
|
|
|
#include <stdio.h> |
|
|
|
#include <pwd.h> |
|
|
@ -56,14 +56,12 @@ std::string dev::getDataDir(std::string _prefix) |
|
|
|
#else |
|
|
|
boost::filesystem::path dataDirPath; |
|
|
|
char const* homeDir = getenv("HOME"); |
|
|
|
#if defined(__APPLE__) |
|
|
|
if (!homeDir || strlen(homeDir) == 0) |
|
|
|
{ |
|
|
|
struct passwd* pwd = getpwuid(getuid()); |
|
|
|
if (pwd) |
|
|
|
homeDir = pwd->pw_dir; |
|
|
|
} |
|
|
|
#endif |
|
|
|
|
|
|
|
if (!homeDir || strlen(homeDir) == 0) |
|
|
|
dataDirPath = boost::filesystem::path("/"); |
|
|
|