From 834805db9fe525dff26267fb7ba2794cee3ed51a Mon Sep 17 00:00:00 2001 From: Ron Yorston Date: Tue, 13 Feb 2018 11:54:43 +0000 Subject: win32: always use safe API calls to manipulate environment It turns out that with the new toolchain safe API calls work on all all platforms. Even the original code from commit fa147bd7e works on Windows XP when built with the new tools. - Remove the unsafe environment manipulation via the environ array - Microsoft's putenv takes a copy of its argument so the string can be freed - Rewrite some routines and add more error checking --- include/mingw.h | 6 ------ 1 file changed, 6 deletions(-) (limited to 'include/mingw.h') diff --git a/include/mingw.h b/include/mingw.h index 87abd077b..6f69913d6 100644 --- a/include/mingw.h +++ b/include/mingw.h @@ -195,16 +195,10 @@ char *mingw_mktemp(char *template); int mkstemp(char *template); char *realpath(const char *path, char *resolved_path); int setenv(const char *name, const char *value, int replace); -#if ENABLE_SAFE_ENV int unsetenv(const char *env); -#else -void unsetenv(const char *env); -#endif #define getenv mingw_getenv -#if ENABLE_SAFE_ENV #define putenv mingw_putenv -#endif #define mktemp mingw_mktemp /* -- cgit v1.2.3-55-g6feb