From 8ad79cebcabe5e0e7ce3af8f4df8bc1a6760046b Mon Sep 17 00:00:00 2001 From: Michael Forney Date: Tue, 14 May 2019 17:14:38 -0700 Subject: driver: Allow empty start/end files Since empty arrays are not allowed, use a single element array containing NULL pointer to specify this. --- driver.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/driver.c b/driver.c index 98e2512..3f5ee1e 100644 --- a/driver.c +++ b/driver.c @@ -285,14 +285,14 @@ buildexe(struct input *inputs, size_t ninputs, char *output) arrayaddptr(&p->cmd, "-o"); arrayaddptr(&p->cmd, output); - if (!flags.nostdlib) + if (!flags.nostdlib && startfiles[0]) arrayaddbuf(&p->cmd, startfiles, sizeof(startfiles)); for (i = 0; i < ninputs; ++i) { if (inputs[i].lib) arrayaddptr(&p->cmd, "-l"); arrayaddptr(&p->cmd, inputs[i].name); } - if (!flags.nostdlib) + if (!flags.nostdlib && endfiles[0]) arrayaddbuf(&p->cmd, endfiles, sizeof(endfiles)); arrayaddptr(&p->cmd, NULL); -- cgit v1.2.3