Remove __GNUC__ conditionals on variable sized local arrays

- We require a C99 compiler anyway so these conditionals are not needed
This commit is contained in:
Panu Matilainen 2012-05-31 16:19:16 +03:00
parent 9dc4c3c2d7
commit 81560ef2e5
1 changed files with 0 additions and 22 deletions

View File

@ -194,16 +194,7 @@ glob(const char *pattern, int flags,
const char *next;
const char *rest;
size_t rest_len;
#ifdef __GNUC__
char onealt[strlen(pattern) - 1];
#else
char *onealt = (char *) xmalloc(strlen(pattern) - 1);
if (onealt == NULL) {
if (!(flags & GLOB_APPEND))
globfree(pglob);
return GLOB_NOSPACE;
}
#endif
/* We know the prefix for all sub-patterns. */
#ifdef HAVE_MEMPCPY
@ -218,9 +209,6 @@ glob(const char *pattern, int flags,
next = next_brace_sub(begin + 1);
if (next == NULL) {
/* It is an illegal expression. */
#ifndef __GNUC__
free(onealt);
#endif
return glob(pattern, flags & ~GLOB_BRACE, errfunc, pglob);
}
@ -230,9 +218,6 @@ glob(const char *pattern, int flags,
rest = next_brace_sub(rest + 1);
if (rest == NULL) {
/* It is an illegal expression. */
#ifndef __GNUC__
free(onealt);
#endif
return glob(pattern, flags & ~GLOB_BRACE, errfunc,
pglob);
}
@ -273,9 +258,6 @@ glob(const char *pattern, int flags,
/* If we got an error, return it. */
if (result && result != GLOB_NOMATCH) {
#ifndef __GNUC__
free(onealt);
#endif
if (!(flags & GLOB_APPEND))
globfree(pglob);
return result;
@ -290,10 +272,6 @@ glob(const char *pattern, int flags,
assert(next != NULL);
}
#ifndef __GNUC__
free(onealt);
#endif
if (pglob->gl_pathc != firstc)
/* We found some entries. */
return 0;