mirror of
https://github.com/neovim/neovim.git
synced 2025-09-19 01:38:16 +00:00
cleanup environment variable handling + unit tests
* removed a putenv() implementation which isn't needed anymore * mch_getenv() and mch_setenv() are now functions in src/os/env.c * removes direct calls to getenv() and setenv() outside of src/os/env.c * refactored the logic of get_env_name into mch_getenvname_at_index * added unittests for the functions in os/env.c
This commit is contained in:

committed by
Thiago de Arruda

parent
fc86866402
commit
f2433aedc8
@@ -89,6 +89,7 @@
|
||||
#include "screen.h"
|
||||
#include "spell.h"
|
||||
#include "ui.h"
|
||||
#include "os/os.h"
|
||||
|
||||
# define WINBYTE BYTE
|
||||
|
||||
@@ -3483,9 +3484,9 @@ char_u * enc_locale() {
|
||||
# if defined(HAVE_LOCALE_H) || defined(X_LOCALE)
|
||||
if ((s = setlocale(LC_CTYPE, NULL)) == NULL || *s == NUL)
|
||||
# endif
|
||||
if ((s = getenv("LC_ALL")) == NULL || *s == NUL)
|
||||
if ((s = getenv("LC_CTYPE")) == NULL || *s == NUL)
|
||||
s = getenv("LANG");
|
||||
if ((s = (char *)mch_getenv("LC_ALL")) == NULL || *s == NUL)
|
||||
if ((s = (char *)mch_getenv("LC_CTYPE")) == NULL || *s == NUL)
|
||||
s = (char *)mch_getenv("LANG");
|
||||
|
||||
if (s == NULL || *s == NUL)
|
||||
return FAIL;
|
||||
|
Reference in New Issue
Block a user