forked from aniani/vim
patch 8.2.4754: using cached values after unsetting some environment variables
Problem: Still using cached values after unsetting some known environment variables. Solution: Take care of the side effects. (closes #10194)
This commit is contained in:
17
src/misc1.c
17
src/misc1.c
@@ -1910,6 +1910,20 @@ vim_unsetenv(char_u *var)
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
* Removes environment variable "name" and take care of side effects.
|
||||
*/
|
||||
void
|
||||
vim_unsetenv_ext(char_u *var)
|
||||
{
|
||||
vim_unsetenv(var);
|
||||
|
||||
// "homedir" is not cleared, keep using the old value until $HOME is set.
|
||||
if (STRICMP(var, "VIM") == 0)
|
||||
didset_vim = FALSE;
|
||||
else if (STRICMP(var, "VIMRUNTIME") == 0)
|
||||
didset_vimruntime = FALSE;
|
||||
}
|
||||
|
||||
/*
|
||||
* Set environment variable "name" and take care of side effects.
|
||||
@@ -1922,8 +1936,7 @@ vim_setenv_ext(char_u *name, char_u *val)
|
||||
init_homedir();
|
||||
else if (didset_vim && STRICMP(name, "VIM") == 0)
|
||||
didset_vim = FALSE;
|
||||
else if (didset_vimruntime
|
||||
&& STRICMP(name, "VIMRUNTIME") == 0)
|
||||
else if (didset_vimruntime && STRICMP(name, "VIMRUNTIME") == 0)
|
||||
didset_vimruntime = FALSE;
|
||||
}
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user