summaryrefslogtreecommitdiff
path: root/ruby.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-02-24 08:21:04 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-02-24 08:21:04 +0000
commitd4819da61111c508a3d582b7cf9957cc896fea14 (patch)
treeb86fe742635cbb45f735cc8380ea1ff86797b4e5 /ruby.c
parent43f7eacdac9d0f719d3d164ffa2f2385f49e3c28 (diff)
parse without $.
* io.c (rb_io_gets_internal): read one line from an IO without setting ARGF.lineno. * parse.y (lex_io_gets): use rb_io_gets_internal not to affect $. global variable. * ruby.c (load_file): no longer reset $. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53913 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ruby.c')
-rw-r--r--ruby.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/ruby.c b/ruby.c
index 13b9dd5..9bc2aa7 100644
--- a/ruby.c
+++ b/ruby.c
@@ -1675,7 +1675,6 @@ struct load_file_arg {
int xflag;
struct cmdline_options *opt;
VALUE f;
- VALUE lineno;
};
static VALUE
@@ -1878,7 +1877,6 @@ restore_load_file(VALUE arg)
{
struct load_file_arg *argp = (struct load_file_arg *)arg;
VALUE f = argp->f;
- VALUE lineno = argp->lineno;
if (argp->script) {
/*
@@ -1898,7 +1896,7 @@ restore_load_file(VALUE arg)
else if (f != rb_stdin) {
rb_io_close(f);
}
- return rb_gv_set("$.", lineno);
+ return Qnil;
}
static NODE *
@@ -1910,7 +1908,6 @@ load_file(VALUE parser, VALUE fname, int script, struct cmdline_options *opt)
arg.script = script;
arg.opt = opt;
arg.xflag = 0;
- arg.lineno = rb_gv_get("$.");
arg.f = open_load_file(rb_str_encode_ospath(fname), &arg.xflag);
return (NODE *)rb_ensure(load_file_internal, (VALUE)&arg,
restore_load_file, (VALUE)&arg);