summaryrefslogtreecommitdiff
path: root/ruby.c
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 /ruby.c
parentae08a031a6560fee564a113f4ba7799430f887f7 (diff)
DATA
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/v1_1r@129 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ruby.c')
-rw-r--r--ruby.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/ruby.c b/ruby.c
index 965027d..0b516fc 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