diff options
author | Nguyễn Thái Ngọc Duy <pclouds@gmail.com> | 2010-09-14 14:12:56 +1000 |
---|---|---|
committer | Nguyễn Thái Ngọc Duy <pclouds@gmail.com> | 2010-09-14 14:22:49 +1000 |
commit | f24b8269a46035feef17eca1c2bf1176c5c23b90 (patch) | |
tree | e3efb2c32f15d968df4c493116e55949f288de9d /win32 | |
parent | ee7c9b2c212fc7db80cce945e094fc2601092283 (diff) | |
download | busybox-w32-f24b8269a46035feef17eca1c2bf1176c5c23b90.tar.gz busybox-w32-f24b8269a46035feef17eca1c2bf1176c5c23b90.tar.bz2 busybox-w32-f24b8269a46035feef17eca1c2bf1176c5c23b90.zip |
win32: implement clearenv()
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 | } |