From f4935a72c6bf55ab65c02f8841b3ce39b42fe0a9 Mon Sep 17 00:00:00 2001 From: matz Date: Fri, 2 May 2003 06:41:33 +0000 Subject: * string.c (rb_str_ljust): now takes optional argument to specify pad string. [ruby-talk:70482] * string.c (rb_str_rjust): ditto. * string.c (rb_str_center): ditto. * string.c (rb_str_justify): utility function. * eval.c (rb_add_method): call singleton_method_added or method_added for every method definition (after ruby_running). [ruby-talk:70471] * array.c (rb_ary_reverse_bang): Array#reverse! should not return nil even for arrays sized less than 2. * io.c (argf_eof): should not block after reading all argument files. (ruby-bugs-ja PR#449) git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@3742 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- io.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'io.c') diff --git a/io.c b/io.c index 75008a97f..78b885517 100644 --- a/io.c +++ b/io.c @@ -3756,13 +3756,12 @@ argf_readchar() static VALUE argf_eof() { - if (!next_argv()) return Qtrue; - if (next_p == 1) { - return Qtrue; - } - if (rb_io_eof(current_file)) { - next_p = 1; - return Qtrue; + if (current_file) { + if (init_p == 0) return Qtrue; + if (rb_io_eof(current_file)) { + next_p = 1; + return Qtrue; + } } return Qfalse; } @@ -4052,7 +4051,6 @@ Init_IO() rb_define_singleton_method(argf, "lineno", argf_lineno, 0); rb_define_singleton_method(argf, "lineno=", argf_set_lineno, 1); - current_file = rb_stdin; rb_global_variable(¤t_file); filename = rb_str_new2("-"); rb_define_readonly_variable("$FILENAME", &filename); -- cgit