forked from enlightenment/efl
eina: handle fallback to HOMEDIR/HOMEPATH on WIN32.
This commit is contained in:
parent
756ed9ccba
commit
01e5432657
|
@ -40,6 +40,10 @@
|
|||
* API *
|
||||
*============================================================================*/
|
||||
|
||||
#ifdef _WIN32
|
||||
static char home_storage[PATH_MAX];
|
||||
#endif
|
||||
|
||||
EAPI const char *
|
||||
eina_environment_home_get(void)
|
||||
{
|
||||
|
@ -48,6 +52,13 @@ eina_environment_home_get(void)
|
|||
|
||||
home = getenv("USERPROFILE");
|
||||
if (!home) home = getenv("WINDIR");
|
||||
if (!home &&
|
||||
(getenv("HOMEDRIVE") && getenv("HOMEPATH")))
|
||||
{
|
||||
snprintf(home_storage, sizeof(home_storage), "%s%s",
|
||||
getenv("HOMEDRIVE"), getenv("HOMEPATH"));
|
||||
home = home_storage;
|
||||
}
|
||||
if (!home) home = "C:\\";
|
||||
|
||||
return home;
|
||||
|
|
Loading…
Reference in New Issue