summaryrefslogtreecommitdiff
path: root/src/misc1.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2018-05-13 15:59:50 +0200
committerBram Moolenaar <Bram@vim.org>2018-05-13 15:59:50 +0200
commit137374fd6538cf9dee0cb22907728d8fdecb5832 (patch)
tree300180a61a2e24db7bd4a085f99c710988b4632b /src/misc1.c
parent8b62e31003693fee4b288e7aea49170f032aeef3 (diff)
downloadvim-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.c11
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.
*/