From d4819da61111c508a3d582b7cf9957cc896fea14 Mon Sep 17 00:00:00 2001 From: nobu Date: Wed, 24 Feb 2016 08:21:04 +0000 Subject: 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 --- parse.y | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'parse.y') diff --git a/parse.y b/parse.y index b533edd2bd..a4a57e260b 100644 --- a/parse.y +++ b/parse.y @@ -5680,10 +5680,12 @@ rb_parser_compile_cstr(VALUE vparser, const char *f, const char *s, int len, int return parser_compile_string(vparser, rb_filesystem_str_new_cstr(f), str, line); } +VALUE rb_io_gets_internal(VALUE io); + static VALUE lex_io_gets(struct parser_params *parser, VALUE io) { - return rb_io_gets(io); + return rb_io_gets_internal(io); } NODE* -- cgit v1.2.3