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

@@ -280,14 +280,6 @@
# else
int mch_rename(const char *src, const char *dest);
# endif
# ifdef __MVS__
/* on OS390 Unix getenv() doesn't return a pointer to persistent
* storage -> use __getenv() */
# define mch_getenv(x) (char_u *)__getenv((char *)(x))
# else
# define mch_getenv(x) (char_u *)getenv((char *)(x))
# endif
# define mch_setenv(name, val, x) setenv(name, val, x)
#if !defined(S_ISDIR) && defined(S_IFDIR)
# define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)