summaryrefslogtreecommitdiff
path: root/ruby.c
diff options
context:
space:
mode:
authorusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-12-19 14:54:50 +0000
committerusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-12-19 14:54:50 +0000
commite446378ad044b7f7464d040eb5cc8f3784732c44 (patch)
tree9a98c9fe619cdbc3e68a496c1cf049b445a3f63a /ruby.c
parente90ccd3beb0b9bf1125461ef68943578739bebbe (diff)
* ruby.c (load_file_internal): use original C string as the filename
for parser. reported by whiteleaf at [ruby-list:49085] [ruby-dev:46738] [Bug #7562] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38474 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ruby.c')
-rw-r--r--ruby.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/ruby.c b/ruby.c
index adc1340..7a0310c 100644
--- a/ruby.c
+++ b/ruby.c
@@ -1569,6 +1569,7 @@ load_file_internal(VALUE arg)
VALUE parser = argp->parser;
VALUE fname_v = rb_str_encode_ospath(argp->fname);
const char *fname = StringValueCStr(fname_v);
+ const char *orig_fname = StringValueCStr(argp->fname);
int script = argp->script;
struct cmdline_options *opt = argp->opt;
VALUE f;
@@ -1702,10 +1703,10 @@ load_file_internal(VALUE arg)
if (NIL_P(f)) {
f = rb_str_new(0, 0);
rb_enc_associate(f, enc);
- return (VALUE)rb_parser_compile_string(parser, fname, f, line_start);
+ return (VALUE)rb_parser_compile_string(parser, orig_fname, f, line_start);
}
rb_funcall(f, set_encoding, 2, rb_enc_from_encoding(enc), rb_str_new_cstr("-"));
- tree = rb_parser_compile_file(parser, fname, f, line_start);
+ tree = rb_parser_compile_file(parser, orig_fname, f, line_start);
rb_funcall(f, set_encoding, 1, rb_parser_encoding(parser));
if (script && tree && rb_parser_end_seen_p(parser)) {
/*