Added mrbc support output to stdout

This commit is contained in:
Yuichiro MASUI
2012-07-29 20:58:02 +09:00
parent c152b10d1f
commit ef993d7549
+4 -1
View File
@@ -135,7 +135,10 @@ parse_args(mrb_state *mrb, int argc, char **argv, struct _args *args)
if (outfile == NULL)
outfile = get_outfilename(infile, args->ext);
if ((args->wfp = fopen(outfile, "wb")) == NULL) {
if (strcmp("-", outfile) == 0) {
args->wfp = stdout;
}
else if ((args->wfp = fopen(outfile, "wb")) == NULL) {
printf("%s: Cannot open output file. (%s)\n", *origargv, outfile);
return 0;
}