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

@@ -737,7 +737,7 @@ static void diff_file(char_u *tmp_orig, char_u *tmp_new, char_u *tmp_diff)
cmd = alloc((unsigned)len);
if (cmd != NULL) {
/* We don't want $DIFF_OPTIONS to get in the way. */
if (getenv("DIFF_OPTIONS"))
if (mch_getenv("DIFF_OPTIONS"))
vim_setenv((char_u *)"DIFF_OPTIONS", (char_u *)"");
/* Build the diff command and execute it. Always use -a, binary