cedric pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=01e543265780e15abbd4893b1b3062320e7680d2

commit 01e543265780e15abbd4893b1b3062320e7680d2
Author: Cedric BAIL <ced...@osg.samsung.com>
Date:   Thu May 14 20:14:56 2015 +0200

    eina: handle fallback to HOMEDIR/HOMEPATH on WIN32.
---
 src/lib/eina/eina_util.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/src/lib/eina/eina_util.c b/src/lib/eina/eina_util.c
index 68c0fcc..392eee3 100644
--- a/src/lib/eina/eina_util.c
+++ b/src/lib/eina/eina_util.c
@@ -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;

-- 


Reply via email to