summaryrefslogtreecommitdiff
path: root/io.c
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-12-12 03:36:49 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-12-12 03:36:49 +0000
commitf7d72f1e6550af0571f15fb93327eb7c901fb104 (patch)
tree8c8b3ce8575b17c778a2ab67a2e893ac8af6d3b4 /io.c
parente585523a2b60a69befc1562fd4c79cfa688bb197 (diff)
precedes registering global VALUE variables before initializing it.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@9677 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'io.c')
-rw-r--r--io.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/io.c b/io.c
index 49d6eb9076..826285842c 100644
--- a/io.c
+++ b/io.c
@@ -5668,12 +5668,12 @@ Init_IO()
rb_define_method(rb_cIO, "pid", rb_io_pid, 0);
rb_define_method(rb_cIO, "inspect", rb_io_inspect, 0);
- rb_stdin = prep_stdio(stdin, FMODE_READABLE, rb_cIO);
rb_define_variable("$stdin", &rb_stdin);
- rb_stdout = prep_stdio(stdout, FMODE_WRITABLE, rb_cIO);
+ rb_stdin = prep_stdio(stdin, FMODE_READABLE, rb_cIO);
rb_define_hooked_variable("$stdout", &rb_stdout, 0, stdout_setter);
- rb_stderr = prep_stdio(stderr, FMODE_WRITABLE, rb_cIO);
+ rb_stdout = prep_stdio(stdout, FMODE_WRITABLE, rb_cIO);
rb_define_hooked_variable("$stderr", &rb_stderr, 0, stdout_setter);
+ rb_stderr = prep_stdio(stderr, FMODE_WRITABLE, rb_cIO);
rb_define_hooked_variable("$>", &rb_stdout, 0, stdout_setter);
orig_stdout = rb_stdout;
rb_deferr = orig_stderr = rb_stderr;
@@ -5687,10 +5687,9 @@ Init_IO()
rb_define_global_const("STDOUT", rb_stdout);
rb_define_global_const("STDERR", rb_stderr);
+ rb_define_readonly_variable("$<", &argf);
argf = rb_obj_alloc(rb_cObject);
rb_extend_object(argf, rb_mEnumerable);
-
- rb_define_readonly_variable("$<", &argf);
rb_define_global_const("ARGF", argf);
rb_define_singleton_method(argf, "to_s", argf_to_s, 0);
@@ -5729,8 +5728,8 @@ Init_IO()
rb_define_singleton_method(argf, "lineno=", argf_set_lineno, 1);
rb_global_variable(&current_file);
- filename = rb_str_new2("-");
rb_define_readonly_variable("$FILENAME", &filename);
+ filename = rb_str_new2("-");
rb_define_virtual_variable("$-i", opt_i_get, opt_i_set);