From e9bd2d2284dafed7b1faec6628690022178e7e18 Mon Sep 17 00:00:00 2001 From: matz Date: Thu, 19 Mar 1998 06:22:55 +0000 Subject: DATA git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/v1_1r@129 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 3 +++ parse.y | 2 -- ruby.c | 7 ++++++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index de34d10280..58f31dca8b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ Wed Mar 18 17:46:31 1998 Yukihiro Matsumoto + * ruby.c (load_file): new file object constant DATA. Only + available for the script from the file. + * regex.c (re_match): forwading failure point popped too much. Tue Mar 17 18:23:06 1998 Yukihiro Matsumoto diff --git a/parse.y b/parse.y index 1c63a28df7..004f4681ec 100644 --- a/parse.y +++ b/parse.y @@ -3939,8 +3939,6 @@ static st_table *rb_symbol_tbl; void Init_sym() { - int strcmp(); - sym_tbl = st_init_strtable(); rb_global_variable((VALUE*)&cur_cref); rb_global_variable((VALUE*)&lex_lastline); diff --git a/ruby.c b/ruby.c index 965027d50a..0b516fce8b 100644 --- a/ruby.c +++ b/ruby.c @@ -537,7 +537,12 @@ load_file(fname, script) RS = rs; } compile_file(fname, f, line_start); - if (f != rb_stdin) io_close(f); + if (script) { + rb_define_global_const("DATA", f); + } + else if (f != rb_stdin) { + io_close(f); + } } void -- cgit v1.2.3