>From 2890a3e3b1f85e904350f959d90bb29af1937b93 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Sun, 12 Feb 2017 00:11:46 -0800 Subject: [PATCH] glob: port better to emscripten Problem reported by Bruno Haible in: http://lists.gnu.org/archive/html/bug-gnulib/2017-02/msg00031.html * lib/glob.c (glob): Don't assume HAVE_GETPWNAM_R || _LIBC. --- ChangeLog | 7 +++++++ lib/glob.c | 6 +++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 6fd7e0c..3d3394c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2017-02-12 Paul Eggert + + glob: port better to emscripten + Problem reported by Bruno Haible in: + http://lists.gnu.org/archive/html/bug-gnulib/2017-02/msg00031.html + * lib/glob.c (glob): Don't assume HAVE_GETPWNAM_R || _LIBC. + 2017-02-11 Bruno Haible host-cpu-c-abi: Support for 64-bit AIX, 32-bit armhf on arm64, hppa64. diff --git a/lib/glob.c b/lib/glob.c index e91c34d..e69a96e 100644 --- a/lib/glob.c +++ b/lib/glob.c @@ -705,12 +705,12 @@ glob (const char *pattern, int flags, int (*errfunc) (const char *, int), if (success) { struct passwd *p; + char *malloc_pwtmpbuf = NULL; + char *pwtmpbuf; # if defined HAVE_GETPWNAM_R || defined _LIBC long int pwbuflenmax = GETPW_R_SIZE_MAX (); size_t pwbuflen = pwbuflenmax; - char *pwtmpbuf; struct passwd pwbuf; - char *malloc_pwtmpbuf = NULL; int save = errno; # ifndef _LIBC @@ -919,11 +919,11 @@ glob (const char *pattern, int flags, int (*errfunc) (const char *, int), /* Look up specific user's home directory. */ { struct passwd *p; + char *malloc_pwtmpbuf = NULL; # if defined HAVE_GETPWNAM_R || defined _LIBC long int buflenmax = GETPW_R_SIZE_MAX (); size_t buflen = buflenmax; char *pwtmpbuf; - char *malloc_pwtmpbuf = NULL; struct passwd pwbuf; int save = errno; -- 2.7.4