aboutsummaryrefslogtreecommitdiff
path: root/driver.c
diff options
context:
space:
mode:
Diffstat (limited to 'driver.c')
-rw-r--r--driver.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/driver.c b/driver.c
index cca2c65..2b1336d 100644
--- a/driver.c
+++ b/driver.c
@@ -201,7 +201,10 @@ buildobj(struct input *input, char *output, enum phaseid last)
if (fd < 0)
fatal("mkstemp:");
close(fd);
- } else if (!output && last != PREPROCESS) {
+ } else if (output) {
+ if (strcmp(output, "-") == 0)
+ output = NULL;
+ } else if (last != PREPROCESS) {
switch (last) {
case COMPILE: ext = "qbe"; break;
case CODEGEN: ext = "s"; break;
@@ -211,8 +214,6 @@ 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) {