summaryrefslogtreecommitdiff
path: root/ruby.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-08-09 13:20:58 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-08-09 13:20:58 +0000
commite941e5050699c9f9806f726aa430feafcc5828ea (patch)
tree2674919b7e9469fce49133931495af6562aabf47 /ruby.c
parenta1a6481ae89be160195128e9304b74db2f363734 (diff)
ruby.c: use String path version parser functions
* ruby.c (load_file_internal): use rb_parser_compile_string_path and rb_parser_compile_file_path, String path name versions. [Bug #8753] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42468 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ruby.c')
-rw-r--r--ruby.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/ruby.c b/ruby.c
index d93f5fdb4c..9e5a5168d4 100644
--- a/ruby.c
+++ b/ruby.c
@@ -1587,9 +1587,9 @@ load_file_internal(VALUE arg)
extern VALUE rb_stdin;
struct load_file_arg *argp = (struct load_file_arg *)arg;
VALUE parser = argp->parser;
- VALUE fname_v = rb_str_encode_ospath(argp->fname);
+ VALUE orig_fname = argp->fname;
+ VALUE fname_v = rb_str_encode_ospath(orig_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;
@@ -1723,10 +1723,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, orig_fname, f, line_start);
+ return (VALUE)rb_parser_compile_string_path(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, orig_fname, f, line_start);
+ tree = rb_parser_compile_file_path(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)) {
/*