This patch documents the changes needed in djdev203 to update getpwnam support
to djdev204 level.  This getpwnam 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/pwd.h djgpp-2.03/include/pwd.h
--- djgpp-2.03.orig/include/pwd.h	1995-02-26 22:31:44 +0100
+++ djgpp-2.03/include/pwd.h	2012-09-23 07:49:10 +0100
@@ -1,32 +1,44 @@
+/* Copyright (C) 2003 DJ Delorie, see COPYING.DJ for details */
+/* Copyright (C) 2001 DJ Delorie, see COPYING.DJ for details */
+/* Copyright (C) 2000 DJ Delorie, see COPYING.DJ for details */
 /* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
 #ifndef __dj_include_pwd_h_
 #define __dj_include_pwd_h_
 
 #ifdef __cplusplus
 extern "C" {
 #endif
 
 #ifndef __dj_ENFORCE_ANSI_FREESTANDING
 
+#if (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) \
+  || !defined(__STRICT_ANSI__) || defined(__cplusplus)
+
+#endif /* (__STDC_VERSION__ >= 199901L) || !__STRICT_ANSI__ */
+
 #ifndef __STRICT_ANSI__
 
 #include <sys/djtypes.h>
 
+#ifndef _GID_T
 __DJ_gid_t
-#undef __DJ_gid_t
-#define __DJ_gid_t
+#define _GID_T
+#endif
+#ifndef _UID_T
 __DJ_uid_t
-#undef __DJ_uid_t
-#define __DJ_uid_t
+#define _UID_T
+#endif
 
 struct passwd {
-  char *	pw_name;
-  uid_t		pw_uid;
-  gid_t		pw_gid;
-  char *	pw_dir;
-  char *	pw_shell;
+  char *	pw_name;		/* Username.  */
+  uid_t 	pw_uid;			/* User ID.  */
+  gid_t 	pw_gid;			/* Group ID.  */
+  char *	pw_dir;			/* Home directory.  */
+  char *	pw_shell;		/* Shell program.  */
+  char *	pw_gecos;		/* Real name.  */
+  char *	pw_passwd;		/* Password.  */
 };
   
 struct passwd *	getpwuid(uid_t _uid);
 struct passwd *	getpwnam(const char *_name);
 
diff -aprNU5 djgpp-2.03.orig/src/libc/posix/pwd/getpwnam.c djgpp-2.03/src/libc/posix/pwd/getpwnam.c
--- djgpp-2.03.orig/src/libc/posix/pwd/getpwnam.c	1998-06-28 18:19:40 +0100
+++ djgpp-2.03/src/libc/posix/pwd/getpwnam.c	2002-10-17 23:00:24 +0100
@@ -1,14 +1,16 @@
+/* Copyright (C) 2001 DJ Delorie, see COPYING.DJ for details */
 /* Copyright (C) 1998 DJ Delorie, see COPYING.DJ for details */
 /* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
 #include <pwd.h>
 #include <unistd.h>
 #include <stdlib.h>
 #include <string.h>
 
-static char slash[] = "/";
-static char shell[] = "sh";
+static char passwd[] = "";
+static char slash [] = "/";
+static char shell [] = "sh";
 
 struct passwd *
 getpwnam(const char *name)
 {
   static struct passwd rv;
@@ -23,7 +25,9 @@ getpwnam(const char *name)
   rv.pw_shell = getenv("SHELL");
   if (rv.pw_shell == 0)
     rv.pw_shell = getenv("COMSPEC");
   if (rv.pw_shell == 0)
     rv.pw_shell = shell;
+  rv.pw_gecos = getlogin();
+  rv.pw_passwd = passwd;
   return &rv;
 }
