Error out when mingw_startup() *and* NO_UNSETENV are active

The unsetenv code has no idea to update our environ_size, therefore
causing segmentation faults when environment variables are removed
without compat/mingw.c's knowing (MinGW's optimized lookup would try
to strcmp() against NULL in such a case).

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
This commit is contained in:
Johannes Schindelin
2015-02-15 09:56:35 +00:00
parent aaac0a2406
commit 8f8df8d906

View File

@@ -263,6 +263,10 @@ char *mingw_mktemp(char *template);
char *mingw_getcwd(char *pointer, int len);
#define getcwd mingw_getcwd
#ifdef NO_UNSETENV
#error "NO_UNSETENV is incompatible with the MinGW startup code!"
#endif
char *mingw_getenv(const char *name);
#define getenv mingw_getenv
int mingw_putenv(const char *namevalue);