aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Forney <mforney@mforney.org>2019-05-14 17:14:38 -0700
committerMichael Forney <mforney@mforney.org>2019-05-14 17:14:43 -0700
commit8ad79cebcabe5e0e7ce3af8f4df8bc1a6760046b (patch)
tree37591bfe45a72a809dc23a05eb7d7da24bab6a24
parent5232fe15fbc24a43b5182bef885415479a71ef9a (diff)
downloadcproc-8ad79cebcabe5e0e7ce3af8f4df8bc1a6760046b.tar.xz
driver: Allow empty start/end files
Since empty arrays are not allowed, use a single element array containing NULL pointer to specify this.
-rw-r--r--driver.c4
1 files 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);