Permalink
Browse files

patch 8.0.1028: MS-Windows: viminfo uses $VIM/_viminfo if $HOME not set

Problem:    MS-Windows: viminfo uses $VIM/_viminfo if $HOME not set. (Yongwei
            Wu)
Solution:   Use vim_getenv() but check it's returning the default "C:/".
  • Loading branch information...
brammool committed Aug 31, 2017
1 parent 2db0ec4 commit 3d593c2dc97c5426316bf343910cad911b2f6b49
Showing with 8 additions and 1 deletion.
  1. +6 −1 src/ex_cmds.c
  2. +2 −0 src/version.c
View
@@ -2098,11 +2098,16 @@ viminfo_filename(char_u *file)
else if ((file = find_viminfo_parameter('n')) == NULL || *file == NUL)
{
#ifdef VIMINFO_FILE2
/* don't use $HOME when not defined (turned into "c:/"!). */
# ifdef VMS
if (mch_getenv((char_u *)"SYS$LOGIN") == NULL)
# else
# ifdef MSWIN
/* Use $VIM only if $HOME is the default "C:/". */
if (STRCMP(vim_getenv((char_u *)"HOME", NULL), "C:/") == 0
&& mch_getenv((char_u *)"HOME") == NULL)
# else
if (mch_getenv((char_u *)"HOME") == NULL)
# endif
# endif
{
/* don't use $VIM when not available. */
View
@@ -769,6 +769,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
1028,
/**/
1027,
/**/

0 comments on commit 3d593c2

Please sign in to comment.