diff options
author | Ron Yorston <rmy@pobox.com> | 2018-02-13 11:54:43 +0000 |
---|---|---|
committer | Ron Yorston <rmy@pobox.com> | 2018-02-13 11:54:43 +0000 |
commit | 834805db9fe525dff26267fb7ba2794cee3ed51a (patch) | |
tree | 3354ca2d465dce743685d0a4b41936d91a2b4d37 /include/mingw.h | |
parent | 5bf7067e61f202f023d70f38d14bb66799a27074 (diff) | |
download | busybox-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.h | 6 |
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); | |||
195 | int mkstemp(char *template); | 195 | int mkstemp(char *template); |
196 | char *realpath(const char *path, char *resolved_path); | 196 | char *realpath(const char *path, char *resolved_path); |
197 | int setenv(const char *name, const char *value, int replace); | 197 | int setenv(const char *name, const char *value, int replace); |
198 | #if ENABLE_SAFE_ENV | ||
199 | int unsetenv(const char *env); | 198 | int unsetenv(const char *env); |
200 | #else | ||
201 | void 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 | /* |