aboutsummaryrefslogtreecommitdiff
path: root/include/mingw.h
diff options
context:
space:
mode:
authorRon Yorston <rmy@pobox.com>2018-02-13 11:54:43 +0000
committerRon Yorston <rmy@pobox.com>2018-02-13 11:54:43 +0000
commit834805db9fe525dff26267fb7ba2794cee3ed51a (patch)
tree3354ca2d465dce743685d0a4b41936d91a2b4d37 /include/mingw.h
parent5bf7067e61f202f023d70f38d14bb66799a27074 (diff)
downloadbusybox-w32-834805db9fe525dff26267fb7ba2794cee3ed51a.tar.gz
busybox-w32-834805db9fe525dff26267fb7ba2794cee3ed51a.tar.bz2
busybox-w32-834805db9fe525dff26267fb7ba2794cee3ed51a.zip
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
Diffstat (limited to 'include/mingw.h')
-rw-r--r--include/mingw.h6
1 files changed, 0 insertions, 6 deletions
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);
195int mkstemp(char *template); 195int mkstemp(char *template);
196char *realpath(const char *path, char *resolved_path); 196char *realpath(const char *path, char *resolved_path);
197int setenv(const char *name, const char *value, int replace); 197int setenv(const char *name, const char *value, int replace);
198#if ENABLE_SAFE_ENV
199int unsetenv(const char *env); 198int unsetenv(const char *env);
200#else
201void unsetenv(const char *env);
202#endif
203 199
204#define getenv mingw_getenv 200#define getenv mingw_getenv
205#if ENABLE_SAFE_ENV
206#define putenv mingw_putenv 201#define putenv mingw_putenv
207#endif
208#define mktemp mingw_mktemp 202#define mktemp mingw_mktemp
209 203
210/* 204/*