This patch documents the changes needed in djdev203 to update unsetenv support
to djdev204.  This locale support is required for both to compile __AND__ use
libiconv, libunistring and gettext with your application.
This changes are not required neither for DJGPP 2.04 nor for a freshly compiled
libc.a from the CVS repository code.

Regards,
Guerrero, Juan Manuel





diff -aprNU5 djgpp-2.03.orig/include/stdlib.h djgpp-2.03/include/stdlib.h
--- djgpp-2.03.orig/include/stdlib.h	1999-06-03 13:22:28 +0100
+++ djgpp-2.03/include/stdlib.h	2014-01-11 16:44:04 +0100
@@ -71,10 +71,12 @@ int	system(const char *_s);
 size_t	wcstombs(char *_s, const wchar_t *_wcs, size_t _n);
 int	wctomb(char *_s, wchar_t _wchar);
 
 #ifndef __STRICT_ANSI__
 
+int	unsetenv(const char *_var);
+
 #ifndef _POSIX_SOURCE
 
 typedef struct {
   long long quot;
   long long rem;
diff -aprNU5 djgpp-2.03.orig/src/libc/posix/stdlib/unsetenv.c djgpp-2.03/src/libc/posix/stdlib/unsetenv.c
--- djgpp-2.03.orig/src/libc/posix/stdlib/unsetenv.c	1970-01-01 01:00:00 +0100
+++ djgpp-2.03/src/libc/posix/stdlib/unsetenv.c	2014-01-11 16:39:40 +0100
@@ -0,0 +1,33 @@
+/* Copyright (C) 2001 DJ Delorie, see COPYING.DJ for details */
+
+#include <libc/stubs.h>
+#include <libc/unconst.h>
+#include <errno.h>
+#include <stdlib.h>
+#include <string.h>
+
+extern char **environ;
+
+int
+unsetenv(const char *name)
+{
+  /* No environment == success */
+  if (environ == 0)
+    return 0;
+
+  /* Check for the failure conditions */
+  if (name == NULL || *name == '\0' || strchr (name, '=') != NULL)
+  {
+    errno = EINVAL;
+    return -1;
+  }
+
+  /* Let putenv() do the work
+   * Note that we can just pass name directly as our putenv() treats
+   * this the same as passing 'name='. */
+  /* The cast is needed because POSIX specifies putenv() to take a non-const
+   * parameter.  Our putenv is well-behaved, so this is OK.  */
+  putenv (unconst (name, char*));
+
+  return 0;
+}
