diff options
author | Daniel Hahler <git@thequod.de> | 2019-10-02 03:43:39 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-10-02 03:43:39 +0200 |
commit | e63fdf63ba057877573dbb3171a8c7ae698cf1bc (patch) | |
tree | 28baa93d934b2574883e0640e3ebce6394039e0f /src/nvim/os/env.c | |
parent | 60b56ed458c6b35d5045959192b49da5a0ea84f3 (diff) | |
parent | eef3809067ae0f613e30b711ef720415c7016381 (diff) | |
download | rneovim-e63fdf63ba057877573dbb3171a8c7ae698cf1bc.tar.gz rneovim-e63fdf63ba057877573dbb3171a8c7ae698cf1bc.tar.bz2 rneovim-e63fdf63ba057877573dbb3171a8c7ae698cf1bc.zip |
Merge pull request #11133 from blueyed/backports
[release-0.4] backports
Diffstat (limited to 'src/nvim/os/env.c')
-rw-r--r-- | src/nvim/os/env.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/nvim/os/env.c b/src/nvim/os/env.c index f5dbf0694e..54fdd7961c 100644 --- a/src/nvim/os/env.c +++ b/src/nvim/os/env.c @@ -135,7 +135,16 @@ int os_setenv(const char *name, const char *value, int overwrite) } #endif uv_mutex_lock(&mutex); - int r = uv_os_setenv(name, value); + int r; +#ifdef WIN32 + // libintl uses getenv() for LC_ALL/LANG/etc., so we must use _putenv_s(). + if (striequal(name, "LC_ALL") || striequal(name, "LANGUAGE") + || striequal(name, "LANG") || striequal(name, "LC_MESSAGES")) { + r = _putenv_s(name, value); // NOLINT + assert(r == 0); + } +#endif + r = uv_os_setenv(name, value); assert(r != UV_EINVAL); // Destroy the old map item. Do this AFTER uv_os_setenv(), because `value` // could be a previous os_getenv() result. |