This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Radu Greab is my hero (the recent cygwin getpw*->pw_comment
authorJarkko Hietaniemi <jhi@iki.fi>
Mon, 8 Sep 2003 20:18:56 +0000 (20:18 +0000)
committerJarkko Hietaniemi <jhi@iki.fi>
Mon, 8 Sep 2003 20:18:56 +0000 (20:18 +0000)
being a bad pointer is apparently a known cygwin bug). The
cure is to initialize the field.

p4raw-id: //depot/perl@21103

pp_sys.c

index f837217..72af678 100644 (file)
--- a/pp_sys.c
+++ b/pp_sys.c
@@ -5208,6 +5208,12 @@ PP(pp_gpwent)
      * --jhi
      */
 
      * --jhi
      */
 
+#   if defined(__CYGWIN__) && defined(USE_REENTRANT_API)
+    /* Cygwin 1.5.3-1 has buggy getpwnam_r() and getpwuid_r():
+     * the pw_comment is left uninitialized. */
+    PL_reentrant_buffer->_pwent_struct.pw_comment = NULL;
+#   endif
+
     switch (which) {
     case OP_GPWNAM:
       {
     switch (which) {
     case OP_GPWNAM:
       {