diff options
-rw-r--r-- | appveyor.yml | 3 | ||||
-rw-r--r-- | src/nvim/os/env.c | 6 |
2 files changed, 9 insertions, 0 deletions
diff --git a/appveyor.yml b/appveyor.yml index bb7bb1c4e9..756c7fea2e 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -40,3 +40,6 @@ cache: artifacts: - path: build/Neovim.zip - path: build/bin/nvim.exe +branches: + only: + - master diff --git a/src/nvim/os/env.c b/src/nvim/os/env.c index 915c0a1f9f..33b67a8116 100644 --- a/src/nvim/os/env.c +++ b/src/nvim/os/env.c @@ -111,6 +111,8 @@ bool os_env_exists(const char *name) /// Sets an environment variable. /// +/// Windows (Vim-compat): Empty string (:let $FOO="") undefines the env var. +/// /// @warning Existing pointers to the result of os_getenv("foo") are /// INVALID after os_setenv("foo", …). int os_setenv(const char *name, const char *value, int overwrite) @@ -123,6 +125,10 @@ int os_setenv(const char *name, const char *value, int overwrite) if (!overwrite && os_getenv(name) != NULL) { return 0; } + if (value[0] == '\0') { + // Windows (Vim-compat): Empty string undefines the env var. + return os_unsetenv(name); + } #else if (!overwrite && os_env_exists(name)) { return 0; |