summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>1998-03-19 06:22:55 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>1998-03-19 06:22:55 +0000
commite9bd2d2284dafed7b1faec6628690022178e7e18 (patch)
tree1979cd82f852e632c81f042296de314576b23bc5
parentae08a031a6560fee564a113f4ba7799430f887f7 (diff)
DATA
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/v1_1r@129 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog3
-rw-r--r--parse.y2
-rw-r--r--ruby.c7
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 <matz@netlab.co.jp>
+ * 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 <matz@netlab.co.jp>
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