]> Savannah Git Hosting - gnulib.git/commitdiff
glob: port better to emscripten
authorPaul Eggert <eggert@cs.ucla.edu>
Sun, 12 Feb 2017 08:11:46 +0000 (00:11 -0800)
committerPaul Eggert <eggert@cs.ucla.edu>
Sun, 12 Feb 2017 08:12:08 +0000 (00:12 -0800)
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
lib/glob.c

index 6fd7e0c637de3c134b62838464480e18e6f24c6a..3d3394c56c6c345f9062790f779836c649baca58 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2017-02-12  Paul Eggert  <eggert@cs.ucla.edu>
+
+       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  <bruno@clisp.org>
 
        host-cpu-c-abi: Support for 64-bit AIX, 32-bit armhf on arm64, hppa64.
index e91c34db65a2057a7fad363428f36c6f22018acc..e69a96e594e201fe80617bfe3e0401f3067f11bf 100644 (file)
@@ -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;