cproc

Unnamed repository; edit this file 'description' to name the repository.
git clone git://git.nihaljere.xyz/cproc
Log | Files | Refs | Submodules | README | LICENSE

commit 8ad79cebcabe5e0e7ce3af8f4df8bc1a6760046b
parent 5232fe15fbc24a43b5182bef885415479a71ef9a
Author: Michael Forney <mforney@mforney.org>
Date:   Tue, 14 May 2019 17:14:38 -0700

driver: Allow empty start/end files

Since empty arrays are not allowed, use a single element array containing
NULL pointer to specify this.

Diffstat:
Mdriver.c | 4++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git 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);