summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorYukihiro "Matz" Matsumoto <[email protected]>2013-03-07 15:25:11 -0800
committerYukihiro "Matz" Matsumoto <[email protected]>2013-03-07 15:25:11 -0800
commitf9fd5d9d1b8a4647cfb157747232047d7067ea9f (patch)
tree7efd4b391058eb33aa3c03cb5b416cf8c700e597
parentcdd41a33de55369bd89bdf916d6ab419bd93c2b5 (diff)
parent245c095da74d8ad89b698ea6c8c556b4a49fd1b7 (diff)
downloadmruby-f9fd5d9d1b8a4647cfb157747232047d7067ea9f.tar.gz
mruby-f9fd5d9d1b8a4647cfb157747232047d7067ea9f.zip
Merge pull request #965 from cremno/mrbc-multiple-outfiles-mem-leak
mrbc: exit if "-o" is specified multiple times
-rw-r--r--tools/mrbc/mrbc.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/tools/mrbc/mrbc.c b/tools/mrbc/mrbc.c
index bc551fffc..698586ec0 100644
--- a/tools/mrbc/mrbc.c
+++ b/tools/mrbc/mrbc.c
@@ -83,6 +83,12 @@ parse_args(mrb_state *mrb, int argc, char **argv, struct _args *args)
switch ((*argv)[1]) {
case 'o':
+ if (outfile) {
+ printf("%s: An output file is already specified. (%s)\n",
+ *origargv, outfile);
+ result = -5;
+ goto exit;
+ }
outfile = get_outfilename((*argv) + 2, "");
break;
case 'B':