1
0
forked from aniani/vim

patch 9.0.1313: some settings use the current codepage instead of 'encoding'

Problem:    Some settings use the current codepage instead of 'encoding'.
Solution:   Adjust how options are initialized. (Ken Takata, closes #11992)
This commit is contained in:
K.Takata
2023-02-15 19:13:43 +00:00
committed by Bram Moolenaar
parent bc3dc298b3
commit ce3189d56e
7 changed files with 70 additions and 17 deletions

View File

@@ -1311,6 +1311,32 @@ free_users(void)
}
#endif
#if defined(MSWIN) || defined(PROTO)
/*
* Initilize $VIM and $VIMRUNTIME when 'enc' is updated.
*/
void
init_vimdir(void)
{
int mustfree;
char_u *p;
mch_get_exe_name();
mustfree = FALSE;
didset_vim = FALSE;
p = vim_getenv((char_u *)"VIM", &mustfree);
if (mustfree)
vim_free(p);
mustfree = FALSE;
didset_vimruntime = FALSE;
p = vim_getenv((char_u *)"VIMRUNTIME", &mustfree);
if (mustfree)
vim_free(p);
}
#endif
/*
* Call expand_env() and store the result in an allocated string.
* This is not very memory efficient, this expects the result to be freed
@@ -1696,7 +1722,7 @@ vim_version_dir(char_u *vimdir)
* Vim's version of getenv().
* Special handling of $HOME, $VIM and $VIMRUNTIME.
* Also does ACP to 'enc' conversion for Win32.
* "mustfree" is set to TRUE when returned is allocated, it must be
* "mustfree" is set to TRUE when the returned string is allocated. It must be
* initialized to FALSE by the caller.
*/
char_u *