summaryrefslogtreecommitdiff
path: root/src/lib/evil
diff options
context:
space:
mode:
authormichelle legrand <michelle.legrand@openwide.fr>2015-01-30 10:49:48 +0100
committerCedric BAIL <cedric@osg.samsung.com>2015-01-30 10:49:48 +0100
commit9350965125c312b084d179cdf1f0f44683320523 (patch)
tree53e81e482f94fe9e509420b18fd073ffdcee009e /src/lib/evil
parent256fc80dbc5c2e72c88df014334797134b807df7 (diff)
evil: get right Windows environment variables for home path.
@fix Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
Diffstat (limited to 'src/lib/evil')
-rw-r--r--src/lib/evil/evil_util.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/lib/evil/evil_util.c b/src/lib/evil/evil_util.c
index 55dffb4685..0fff26d1b3 100644
--- a/src/lib/evil/evil_util.c
+++ b/src/lib/evil/evil_util.c
@@ -207,8 +207,17 @@ const char *
207evil_homedir_get(void) 207evil_homedir_get(void)
208{ 208{
209 char *homedir; 209 char *homedir;
210 char *homedrive;
211 char *homepath;
210 212
211 homedir = getenv("HOME"); 213 homedir = getenv("HOME");
214 if (!homedir)
215 {
216 homedrive = getenv("HOMEDRIVE");
217 homepath = getenv("HOMEPATH");
218 if (homedrive && homepath)
219 asprintf(&homedir, "%s%s", homedrive, homepath);
220 }
212 if (!homedir) homedir = getenv("USERPROFILE"); 221 if (!homedir) homedir = getenv("USERPROFILE");
213 if (!homedir) homedir = getenv("WINDIR"); 222 if (!homedir) homedir = getenv("WINDIR");
214 if (!homedir) homedir="C:\\"; 223 if (!homedir) homedir="C:\\";