diff options
author | zeertzjq <zeertzjq@outlook.com> | 2022-08-21 11:37:13 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-21 11:37:13 +0800 |
commit | 6b9852cc4188d9ca7bce8e7592dcfca38539c743 (patch) | |
tree | 3e3dbcffc76ecac8ffa2862a1d307483c4091f0c /src/nvim/eval/vars.c | |
parent | 506a3ec91359da077eee81c82d23c4805ad22f9a (diff) | |
download | rneovim-6b9852cc4188d9ca7bce8e7592dcfca38539c743.tar.gz rneovim-6b9852cc4188d9ca7bce8e7592dcfca38539c743.tar.bz2 rneovim-6b9852cc4188d9ca7bce8e7592dcfca38539c743.zip |
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)
https://github.com/vim/vim/commit/7714231bb5b15f7c85453f3945c108478de1d08a
Cherry-pick vim_setenv_ext() from patch 8.2.0200.
Diffstat (limited to 'src/nvim/eval/vars.c')
-rw-r--r-- | src/nvim/eval/vars.c | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/src/nvim/eval/vars.c b/src/nvim/eval/vars.c index 1ede7b35d3..b38849730a 100644 --- a/src/nvim/eval/vars.c +++ b/src/nvim/eval/vars.c @@ -593,15 +593,7 @@ static char *ex_let_one(char *arg, typval_T *const tv, const bool copy, const bo } } if (p != NULL) { - os_setenv(name, p, 1); - if (STRICMP(name, "HOME") == 0) { - init_homedir(); - } else if (didset_vim && STRICMP(name, "VIM") == 0) { - didset_vim = false; - } else if (didset_vimruntime - && STRICMP(name, "VIMRUNTIME") == 0) { - didset_vimruntime = false; - } + vim_setenv_ext(name, p); arg_end = arg; } name[len] = c1; @@ -859,7 +851,7 @@ static int do_unlet_var(lval_T *lp, char *name_end, exarg_T *eap, int deep FUNC_ // Environment variable, normal name or expanded name. if (*lp->ll_name == '$') { - os_unsetenv(lp->ll_name + 1); + vim_unsetenv_ext(lp->ll_name + 1); } else if (do_unlet(lp->ll_name, lp->ll_name_len, forceit) == FAIL) { ret = FAIL; } |