From b25c5d66b27045e44e435dbc65b6213840d377f6 Mon Sep 17 00:00:00 2001 From: Roland McGrath Date: Mon, 7 Aug 1995 21:45:04 +0000 Subject: * stdlib/strtol.c: Use #ifdef, not #if, for HAVE_LIMITS_H. * posix/glob.c (glob_in_dir): Allocate GLOB_MARK byte in case when (NFOUND == 0 && (FLAGS & GLOB_NOCHECK)). --- posix/glob.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'posix/glob.c') diff --git a/posix/glob.c b/posix/glob.c index 38a6d75..1354150 100644 --- a/posix/glob.c +++ b/posix/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); -- cgit v1.1