From 813dad7afd646e675d191fe6eac8e7a70e37aefe Mon Sep 17 00:00:00 2001 From: nobu Date: Tue, 3 Feb 2009 14:37:09 +0000 Subject: * ruby.c (load_file_internal): resets EOF flag after parse. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22017 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ruby.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'ruby.c') diff --git a/ruby.c b/ruby.c index 01550929e5..6ac062981b 100644 --- a/ruby.c +++ b/ruby.c @@ -1581,7 +1581,6 @@ load_file_internal(VALUE arg) rb_io_ungetbyte(f, c); } require_libraries(opt); /* Why here? unnatural */ - rb_io_ungetbyte(f, Qnil); } if (opt->src.enc.index >= 0) { enc = rb_enc_from_index(opt->src.enc.index); @@ -1601,6 +1600,9 @@ load_file_internal(VALUE arg) else if (f != rb_stdin) { rb_io_close(f); } + else { + rb_io_ungetbyte(f, Qnil); + } return (VALUE)tree; } -- cgit v1.2.3