mirror of
https://github.com/vim/vim.git
synced 2025-09-24 03:44:06 -04:00
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:/".
This commit is contained in:
@@ -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. */
|
||||
|
@@ -769,6 +769,8 @@ static char *(features[]) =
|
||||
|
||||
static int included_patches[] =
|
||||
{ /* Add new patch number below this line */
|
||||
/**/
|
||||
1028,
|
||||
/**/
|
||||
1027,
|
||||
/**/
|
||||
|
Reference in New Issue
Block a user