diff options
author | Stefan Hoffmann <stefan991@gmail.com> | 2014-03-03 20:02:32 +0100 |
---|---|---|
committer | Thiago de Arruda <tpadilha84@gmail.com> | 2014-03-06 13:38:45 -0300 |
commit | f2433aedc86db171d5616410605cf0d398d8fdc2 (patch) | |
tree | 2df40baf1dce2b9e6e6dc175f66cfff41d7bd6ad /src/ex_cmds2.c | |
parent | fc8686640250561156913387c62924d2bdb5e1ac (diff) | |
download | rneovim-f2433aedc86db171d5616410605cf0d398d8fdc2.tar.gz rneovim-f2433aedc86db171d5616410605cf0d398d8fdc2.tar.bz2 rneovim-f2433aedc86db171d5616410605cf0d398d8fdc2.zip |
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
Diffstat (limited to 'src/ex_cmds2.c')
-rw-r--r-- | src/ex_cmds2.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/ex_cmds2.c b/src/ex_cmds2.c index f08aab0300..e005472695 100644 --- a/src/ex_cmds2.c +++ b/src/ex_cmds2.c @@ -3322,11 +3322,11 @@ static char_u *get_mess_env(void); static char_u *get_mess_env(void) { char_u *p; - p = mch_getenv((char_u *)"LC_ALL"); + p = (char_u *)mch_getenv("LC_ALL"); if (p == NULL || *p == NUL) { - p = mch_getenv((char_u *)"LC_MESSAGES"); + p = (char_u *)mch_getenv("LC_MESSAGES"); if (p == NULL || *p == NUL) { - p = mch_getenv((char_u *)"LANG"); + p = (char_u *)mch_getenv("LANG"); if (p != NULL && VIM_ISDIGIT(*p)) p = NULL; /* ignore something like "1043" */ # ifdef HAVE_GET_LOCALE_VAL |