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:
Stefan Hoffmann
2014-03-03 20:02:32 +01:00
committed by Thiago de Arruda
parent fc86866402
commit f2433aedc8
16 changed files with 207 additions and 250 deletions

View File

@@ -30,6 +30,7 @@
#include "screen.h"
#include "term.h"
#include "ui.h"
#include "os/os.h"
#if defined(FEAT_FLOAT) && defined(HAVE_MATH_H)
# include <math.h>
@@ -736,11 +737,11 @@ int delete_first_msg(void) {
void ex_messages(exarg_T *eap)
{
struct msg_hist *p;
char_u *s;
const char *s;
msg_hist_off = TRUE;
s = mch_getenv((char_u *)"LANG");
s = mch_getenv("LANG");
if (s != NULL && *s != NUL)
msg_attr((char_u *)
_("Messages maintainer: Bram Moolenaar <Bram@vim.org>"),