diff options
author | Bram Moolenaar <Bram@vim.org> | 2018-05-13 15:59:50 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2018-05-13 15:59:50 +0200 |
commit | 137374fd6538cf9dee0cb22907728d8fdecb5832 (patch) | |
tree | 300180a61a2e24db7bd4a085f99c710988b4632b /src/misc1.c | |
parent | 8b62e31003693fee4b288e7aea49170f032aeef3 (diff) | |
download | vim-git-137374fd6538cf9dee0cb22907728d8fdecb5832.tar.gz |
patch 8.0.1832: cannot use :unlet for an environment variablev8.0.1832
Problem: Cannot use :unlet for an environment variable.
Solution: Make it work. Use unsetenv() if available. (Ken Takata,
closes #2855)
Diffstat (limited to 'src/misc1.c')
-rw-r--r-- | src/misc1.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/misc1.c b/src/misc1.c index 6c77f4b0d..1ab55f086 100644 --- a/src/misc1.c +++ b/src/misc1.c @@ -4479,6 +4479,17 @@ remove_tail(char_u *p, char_u *pend, char_u *name) return pend; } + void +vim_unsetenv(char_u *var) +{ +#ifdef HAVE_UNSETENV + unsetenv((char *)var); +#else + mch_setenv((char *)var, "", 0); +#endif +} + + /* * Our portable version of setenv. */ |