From: Paul Eggert Date: Sun, 12 Feb 2017 08:11:46 +0000 (-0800) Subject: glob: port better to emscripten X-Git-Tag: v1.0~6366 X-Git-Url: https://gitweb.git.savannah.gnu.org/gitweb/?a=commitdiff_plain;h=26b8e1b3cd2e32100c9e13f627f7f879e393f08f;p=gnulib.git 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. --- diff --git a/ChangeLog b/ChangeLog index 6fd7e0c637..3d3394c56c 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 e91c34db65..e69a96e594 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;