aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/os/env.c
diff options
context:
space:
mode:
authorScott Prager <splinterofchaos@gmail.com>2015-04-14 15:45:39 -0400
committerScott Prager <splinterofchaos@gmail.com>2015-04-14 15:45:39 -0400
commitb47ea5fcdefb2ce33bae3d61d79310646aa8d1a1 (patch)
treedebc07712054605b63f1867e8b23609a3f6b49ca /src/nvim/os/env.c
parentd22f2f94047a5ed1e930ee46d0d2e8d6aacfa104 (diff)
parent9353fcf024e4752c20c59a9c519f080e33cc5df2 (diff)
downloadrneovim-b47ea5fcdefb2ce33bae3d61d79310646aa8d1a1.tar.gz
rneovim-b47ea5fcdefb2ce33bae3d61d79310646aa8d1a1.tar.bz2
rneovim-b47ea5fcdefb2ce33bae3d61d79310646aa8d1a1.zip
Merge pull request #2331 from splinterofchaos/serverlisten
vimL: serverlisten({addr}), list(), and stop({addr})
Diffstat (limited to 'src/nvim/os/env.c')
-rw-r--r--src/nvim/os/env.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/nvim/os/env.c b/src/nvim/os/env.c
index 37158f4d3c..be4b22de3a 100644
--- a/src/nvim/os/env.c
+++ b/src/nvim/os/env.c
@@ -37,6 +37,19 @@ int os_setenv(const char *name, const char *value, int overwrite)
return setenv(name, value, overwrite);
}
+/// Unset environment variable
+///
+/// For systems where unsetenv() is not available the value will be set as an
+/// empty string
+int os_unsetenv(const char *name)
+{
+#ifdef HAVE_UNSETENV
+ return unsetenv(name);
+#else
+ return os_setenv(name, "", 1);
+#endif
+}
+
char *os_getenvname_at_index(size_t index)
{
# if defined(HAVE__NSGETENVIRON)