diff options
Diffstat (limited to 'win32')
-rw-r--r-- | win32/env.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/win32/env.c b/win32/env.c index 376ad9d47..21b5f3d2f 100644 --- a/win32/env.c +++ b/win32/env.c | |||
@@ -115,5 +115,14 @@ void unsetenv(const char *env) | |||
115 | 115 | ||
116 | int clearenv(void) | 116 | int clearenv(void) |
117 | { | 117 | { |
118 | bb_error_msg_and_die("clearenv() is not supported"); | 118 | char **env = environ; |
119 | if (!env) | ||
120 | return 0; | ||
121 | while (*env) { | ||
122 | free(*env); | ||
123 | env++; | ||
124 | } | ||
125 | free(env); | ||
126 | environ = NULL; | ||
127 | return 0; | ||
119 | } | 128 | } |