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 ce9b800fb06ef33ad9bec59f3238e02599b6a71d
parent 82d4b0852ecb1cda828a072be919d846eb326f77
Author: Michael Forney <mforney@mforney.org>
Date:   Thu, 21 Feb 2019 00:59:08 -0800

driver: Fix -o -

We need to distinguish between no output specified, and output specified
to be standard out.

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

diff --git a/driver.c b/driver.c @@ -211,6 +211,8 @@ buildobj(struct input *input, char *output, enum phaseid last) } if (strcmp(input->name, "-") == 0) input->name = NULL; + if (strcmp(output, "-") == 0) + output = NULL; npids = 0; for (i = first, fd = -1, phaseoutput = NULL; i <= last; ++i, ++npids) { @@ -468,7 +470,6 @@ main(int argc, char *argv[]) if (strcmp(output, "-") == 0) { if (last >= ASSEMBLE) usage("cannot write object to stdout"); - output = NULL; } else if (last != LINK && inputs.len > sizeof(*input)) { usage("cannot specify -o with multiple input files without linking"); }