summaryrefslogtreecommitdiffhomepage
path: root/tools
diff options
context:
space:
mode:
authorYuichiro MASUI <[email protected]>2012-07-29 20:58:02 +0900
committerYuichiro MASUI <[email protected]>2012-07-29 20:58:02 +0900
commitef993d75495c95a57863d6d0f900acbe8778336e (patch)
tree7dc4ea152c8dc3b58fa93f79ed65b71e2a55f022 /tools
parentc152b10d1f619591846249ac94869e3f3529b928 (diff)
downloadmruby-ef993d75495c95a57863d6d0f900acbe8778336e.tar.gz
mruby-ef993d75495c95a57863d6d0f900acbe8778336e.zip
Added mrbc support output to stdout
Diffstat (limited to 'tools')
-rw-r--r--tools/mrbc/mrbc.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/tools/mrbc/mrbc.c b/tools/mrbc/mrbc.c
index 428a3b781..f9810aa4f 100644
--- a/tools/mrbc/mrbc.c
+++ b/tools/mrbc/mrbc.c
@@ -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;
}