]> Savannah Git Hosting - gnulib.git/commitdiff
glob: don't assume getpwnam_r
authorPaul Eggert <eggert@cs.ucla.edu>
Sat, 2 Sep 2017 09:00:40 +0000 (02:00 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Sat, 2 Sep 2017 09:06:58 +0000 (02:06 -0700)
* lib/glob.c (glob): Port recent patches to platforms
lacking getpwnam_r.

ChangeLog
lib/glob.c

index 11594803fec1dbede7dba092c0c93b6a45b9d956..4314e917f7df0ffd405e613e3920da713e4720f7 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 2017-09-02  Paul Eggert  <eggert@cs.ucla.edu>
 
+       glob: don't assume getpwnam_r
+       * lib/glob.c (glob): Port recent patches to platforms
+       lacking getpwnam_r.
+
        scratch_buffer: don’t use private glibc API
        Suggested by Florian Weimer in:
        http://lists.gnu.org/archive/html/bug-gnulib/2017-09/msg00004.html
index 596ae6c93ab31baad19eeb094418cba59369c438..e9cf775c5d533928fd6e9a87d9be24feecdafb1a 100644 (file)
@@ -637,11 +637,11 @@ glob (const char *pattern, int flags, int (*errfunc) (const char *, int),
               if (success)
                 {
                   struct passwd *p;
-# if defined HAVE_GETPWNAM_R || defined _LIBC
-                  struct passwd pwbuf;
                   int save = errno;
                   struct scratch_buffer pwtmpbuf;
                   scratch_buffer_init (&pwtmpbuf);
+# if defined HAVE_GETPWNAM_R || defined _LIBC
+                  struct passwd pwbuf;
 
                   while (getpwnam_r (name, &pwbuf,
                                      pwtmpbuf.data, pwtmpbuf.length, &p)