0
0
mirror of https://github.com/vim/vim.git synced 2025-09-23 03:43:49 -04:00

patch 8.0.1832: cannot use :unlet for an environment variable

Problem:    Cannot use :unlet for an environment variable.
Solution:   Make it work.  Use unsetenv() if available. (Ken Takata,
            closes #2855)
This commit is contained in:
Bram Moolenaar
2018-05-13 15:59:50 +02:00
parent 8b62e31003
commit 137374fd65
9 changed files with 63 additions and 2 deletions

View File

@@ -2758,6 +2758,20 @@ ex_unletlock(
do
{
if (*arg == '$')
{
char_u *name = ++arg;
if (get_env_len(&arg) == 0)
{
EMSG2(_(e_invarg2), name - 1);
return;
}
vim_unsetenv(name);
arg = skipwhite(arg);
continue;
}
/* Parse the name and find the end. */
name_end = get_lval(arg, NULL, &lv, TRUE, eap->skip || error, 0,
FNE_CHECK_START);