Updated from libc
authorRoland McGrath <roland@redhat.com>
Thu, 10 Aug 1995 23:29:54 +0000 (23:29 +0000)
committerRoland McGrath <roland@redhat.com>
Thu, 10 Aug 1995 23:29:54 +0000 (23:29 +0000)
glob/ChangeLog
glob/glob.c

index d8cd316bb10d42b8af6ca9de0865bdd6cdf8ec07..481214dbe1d2c798e636b88ccf78021705e2994f 100644 (file)
@@ -1,3 +1,8 @@
+Mon Aug  7 14:04:36 1995  Roland McGrath  <roland@churchy.gnu.ai.mit.edu>
+
+       * posix/glob.c (glob_in_dir): Allocate GLOB_MARK byte in case when
+       (NFOUND == 0 && (FLAGS & GLOB_NOCHECK)).
+
 Sat Apr 29 15:46:57 1995  Roland McGrath  <roland@churchy.gnu.ai.mit.edu>
 
        * posix/glob.c (S_ISDIR): Define if undefined.
index 38a6d75ab2e6d215375f9a8da5cf642f71388792..1354150653c9265563579c0fefa21d17138c7f9f 100644 (file)
@@ -635,7 +635,7 @@ glob_in_dir (pattern, directory, flags, errfunc, pglob)
       nfound = 1;
       names = (struct globlink *) __alloca (sizeof (struct globlink));
       names->next = NULL;
-      names->name = (char *) malloc (len + 1);
+      names->name = (char *) malloc (len + ((flags & GLOB_MARK) ? 1 : 0) + 1);
       if (names->name == NULL)
        goto memory_error;
       memcpy (names->name, pattern, len);