add USE_PORTABLE_CODE option and use it in find applet

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
Denys Vlasenko
2009-09-13 14:57:24 +02:00
parent 7649bd024c
commit aa7da73880
2 changed files with 12 additions and 0 deletions

View File

@ -276,7 +276,11 @@ ACTF(inum)
ACTF(exec)
{
int i, rc;
#if ENABLE_USE_PORTABLE_CODE
char **argv = alloca(sizeof(char*) * (ap->exec_argc + 1));
#else /* gcc 4.3.1 generates smaller code: */
char *argv[ap->exec_argc + 1];
#endif
for (i = 0; i < ap->exec_argc; i++)
argv[i] = subst(ap->exec_argv[i], ap->subst_count[i], fileName);
argv[i] = NULL; /* terminate the list */