2 libc of DJGPP 2.03 does not offer function unsetenv,
3 so this version from DJGPP 2.04 CVS tree is supplied.
4 This file will become superflous and will be removed
5 from the distribution as soon as DJGPP 2.04 has been
9 /* Copyright (C) 2001 DJ Delorie, see COPYING.DJ for details */
11 #include <libc/stubs.h>
12 #include <libc/unconst.h>
17 extern char **environ
;
20 unsetenv(const char *name
)
22 /* No environment == success */
26 /* Check for the failure conditions */
27 if (name
== NULL
|| *name
== '\0' || strchr (name
, '=') != NULL
)
33 /* Let putenv() do the work
34 * Note that we can just pass name directly as our putenv() treats
35 * this the same as passing 'name='. */
36 /* The cast is needed because POSIX specifies putenv() to take a non-const
37 * parameter. Our putenv is well-behaved, so this is OK. */
38 putenv (unconst (name
, char*));