vim-patch:8.2.4754: using cached values after unsetting some environment variables (#19872)

Problem:    Still using cached values after unsetting some known environment
            variables.
Solution:   Take care of the side effects. (closes vim/vim#10194)
7714231bb5

Cherry-pick vim_setenv_ext() from patch 8.2.0200.
This commit is contained in:
zeertzjq
2022-08-21 11:37:13 +08:00
committed by GitHub
parent 506a3ec913
commit 6b9852cc41
5 changed files with 54 additions and 17 deletions

View File

@@ -7629,9 +7629,9 @@ static void f_setenv(typval_T *argvars, typval_T *rettv, FunPtr fptr)
if (argvars[1].v_type == VAR_SPECIAL
&& argvars[1].vval.v_special == kSpecialVarNull) {
os_unsetenv(name);
vim_unsetenv_ext(name);
} else {
os_setenv(name, tv_get_string_buf(&argvars[1], valbuf), 1);
vim_setenv_ext(name, tv_get_string_buf(&argvars[1], valbuf));
}
}