Skip to content
Browse files

preserve script file name

  • Loading branch information...
1 parent 70916d0 commit cf2bd3469a08ac20cffa62fe00c54fd69844fcfa @matz matz committed Oct 5, 2012
Showing with 2 additions and 1 deletion.
  1. +2 −1 tools/mruby/mruby.c
View
3 tools/mruby/mruby.c
@@ -139,6 +139,7 @@ parse_args(mrb_state *mrb, int argc, char **argv, struct _args *args)
return 0;
}
args->fname = 1;
+ args->cmdline = argv[0];
argc--; argv++;
}
}
@@ -154,7 +155,7 @@ cleanup(mrb_state *mrb, struct _args *args)
{
if (args->rfp && args->rfp != stdin)
fclose(args->rfp);
- if (args->cmdline)
+ if (args->cmdline && !args->fname)
mrb_free(mrb, args->cmdline);
if (args->argv)
mrb_free(mrb, args->argv);

0 comments on commit cf2bd34

Please sign in to comment.
Something went wrong with that request. Please try again.