diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2012-07-29 17:38:40 -0700 |
|---|---|---|
| committer | Yukihiro "Matz" Matsumoto <[email protected]> | 2012-07-29 17:38:40 -0700 |
| commit | 179b2aceeadcd3c5fdac425737280bb09e0ba2d0 (patch) | |
| tree | f06edb977136dadb379d0f512cdc0ae97d60b3e3 /tools | |
| parent | e56cd70cdb3adb073609ceb6eb0889c7181263be (diff) | |
| parent | ef993d75495c95a57863d6d0f900acbe8778336e (diff) | |
| download | mruby-179b2aceeadcd3c5fdac425737280bb09e0ba2d0.tar.gz mruby-179b2aceeadcd3c5fdac425737280bb09e0ba2d0.zip | |
Merge pull request #406 from MobiRuby/mrbc_stdin
Added mrbc support output to stdout
Diffstat (limited to 'tools')
| -rw-r--r-- | tools/mrbc/mrbc.c | 5 |
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; } |
