mirror of
https://github.com/neovim/neovim.git
synced 2025-10-02 07:58:35 +00:00
Implement os_unsetenv()
- In UNIX systems where unsetenv() is available, it is used. Otherwise the variables are set with the empty string. - New check HAVE_UNSETENV for unsetenv() - Added unit test to env_spec.lua
This commit is contained in:

committed by
Scott Prager

parent
a9ee85b9fc
commit
71487a935e
@@ -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)
|
||||
|
Reference in New Issue
Block a user