This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH 05/18] posix: Rewrite to use struct scratch_buffer instead of extend_alloca


Adhemerval Zanella wrote:
+		  p = getpwnam (pwtmpbuf.data);

That won't work on non-glibc platforms that lack getpwnam_r, as the argument should be 'name'. I installed the attached patch to Gnulib to fix this.
>From 88855bf9f1cfc2e5165e4200bf62aa949e76db90 Mon Sep 17 00:00:00 2001
From: Paul Eggert <eggert@cs.ucla.edu>
Date: Sat, 2 Sep 2017 03:37:46 -0700
Subject: [PATCH] glob: fix typo in recent change

* lib/glob.c (glob) [!HAVE_GETPWNAM_R && !_LIBC]:
Fix recently-introduced typo.
---
 ChangeLog  | 4 ++++
 lib/glob.c | 2 +-
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/ChangeLog b/ChangeLog
index 867662d..4dd0367 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 2017-09-02  Paul Eggert  <eggert@cs.ucla.edu>
 
+	glob: fix typo in recent change
+	* lib/glob.c (glob) [!HAVE_GETPWNAM_R && !_LIBC]:
+	Fix recently-introduced typo.
+
 	glob: don't save and restore errno unnecessarily
 	* lib/glob.c (glob): Don't save and restore errno
 	merely because we have getpwnam_r.
diff --git a/lib/glob.c b/lib/glob.c
index 8de2d5f..f1b30ee 100644
--- a/lib/glob.c
+++ b/lib/glob.c
@@ -658,7 +658,7 @@ glob (const char *pattern, int flags, int (*errfunc) (const char *, int),
                         }
                     }
 # else
-                  p = getpwnam (pwtmpbuf.data);
+                  p = getpwnam (name);
 # endif
                   if (p != NULL)
                     {
-- 
2.7.4


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]