diff mbox

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

Message ID bc79b9d4-88a6-b9b0-a1e7-bb021eac761d@cs.ucla.edu
State New, archived
Headers show

Commit Message

Paul Eggert Sept. 2, 2017, 10:40 a.m. UTC
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.
diff mbox

Patch

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