blob: 37d78cff6f762f24e7a84d53219e1e052f1b4fac [file] [log] [blame]
/**
* @file compat_posix.cpp
* Compatibility functions for POSIX
*
* @author Ben Gardner
* @license GPL v2+
*/
#ifndef WIN32
#include <cstdlib>
#include <string>
bool unc_getenv(const char *name, std::string& str)
{
const char *val = getenv(name);
if (val)
{
str = val;
return true;
}
return false;
}
bool unc_homedir(std::string& home)
{
if (unc_getenv("HOME", home))
{
return true;
}
return false;
}
#endif /* ifndef WIN32 */