evil: get right Windows environment variables for home path.

@fix

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
This commit is contained in:
michelle legrand 2015-01-30 10:49:48 +01:00 committed by Cedric BAIL
parent 256fc80dbc
commit 9350965125
1 changed files with 9 additions and 0 deletions

View File

@ -207,8 +207,17 @@ const char *
evil_homedir_get(void)
{
char *homedir;
char *homedrive;
char *homepath;
homedir = getenv("HOME");
if (!homedir)
{
homedrive = getenv("HOMEDRIVE");
homepath = getenv("HOMEPATH");
if (homedrive && homepath)
asprintf(&homedir, "%s%s", homedrive, homepath);
}
if (!homedir) homedir = getenv("USERPROFILE");
if (!homedir) homedir = getenv("WINDIR");
if (!homedir) homedir="C:\\";