core: execl_: Allow 1000 arguments.

* src/posix.c (execl_): Allow 1000 arguments.
This commit is contained in:
Jan Nieuwenhuizen 2018-06-26 06:05:20 +02:00
parent 50d7036e03
commit 7be16f51b3
No known key found for this signature in database
GPG Key ID: F3C1A0D9C1D65273
1 changed files with 8 additions and 3 deletions

View File

@ -270,15 +270,20 @@ primitive_fork ()
SCM
execl_ (SCM file_name, SCM args) ///((name . "execl"))
{
char *c_argv[100];
char *c_argv[1000]; // POSIX minimum 4096
int i = 0;
int n = 0;
int n = n;
if (length__ (args) > 1000)
error (cell_symbol_system_error,
cons (file_name,
cons (MAKE_STRING (cstring_to_list ("too many arguments")),
cons (file_name, args))));
c_argv[i++] = string_to_cstring_ (file_name, string_to_cstring_buf+n);
n += length__ (STRING (file_name)) + 1;
while (args != cell_nil)
{
assert (TYPE (CAR (args)) == TSTRING);
assert (i < 20);
c_argv[i++] = string_to_cstring_ (CAR (args), string_to_cstring_buf+n);
n += length__ (STRING (CAR (args))) + 1;
args = CDR (args);