summaryrefslogtreecommitdiff
path: root/glob/glob.c
diff options
context:
space:
mode:
authorRoland McGrath <roland@redhat.com>1995-08-10 23:29:54 +0000
committerRoland McGrath <roland@redhat.com>1995-08-10 23:29:54 +0000
commit030d31ba93c25ff635290e02ee16a1da3dd977bf (patch)
tree228a8ab561d9a37af1b0a24d13703be0b94dfabe /glob/glob.c
parent70465ffcfbd67461eb879e2c8c7d59aeda138aa9 (diff)
downloadgunmake-030d31ba93c25ff635290e02ee16a1da3dd977bf.tar.gz
Updated from libc
Diffstat (limited to 'glob/glob.c')
-rw-r--r--glob/glob.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/glob/glob.c b/glob/glob.c
index 38a6d75..1354150 100644
--- a/glob/glob.c
+++ b/glob/glob.c
@@ -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);