diff options
author | Michael Forney <mforney@mforney.org> | 2019-02-21 00:59:08 -0800 |
---|---|---|
committer | Michael Forney <mforney@mforney.org> | 2019-02-21 00:59:51 -0800 |
commit | ce9b800fb06ef33ad9bec59f3238e02599b6a71d (patch) | |
tree | 1fb3ce90e61115a4d78cf4383b110958ed45da5b | |
parent | 82d4b0852ecb1cda828a072be919d846eb326f77 (diff) | |
download | cproc-ce9b800fb06ef33ad9bec59f3238e02599b6a71d.tar.xz |
driver: Fix -o -
We need to distinguish between no output specified, and output specified
to be standard out.
-rw-r--r-- | driver.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -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"); } |