diff --git a/ChangeLog b/ChangeLog index 3d2224faa6..074787b667 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +Wed Jun 17 00:31:30 2009 Yukihiro Matsumoto + + * test/ruby/test_argf.rb (TestArgf#test_skip): updated test + according to clarified behavior. + +Tue Jun 16 06:40:31 2009 Yukihiro Matsumoto + + * io.c (argf_skip): should close only when current_file is available. + Mon Jun 15 22:35:31 2009 Tadayoshi Funaba * bignum.c (rb_big2db): (-Float::MAX.to_i*2).to_f should return diff --git a/io.c b/io.c index 477d1168ee..73ca7df3c1 100644 --- a/io.c +++ b/io.c @@ -8292,7 +8292,7 @@ argf_binmode_p(VALUE argf) static VALUE argf_skip(VALUE argf) { - if (ARGF.next_p != -1) { + if (ARGF.init_p && ARGF.next_p == 0) { argf_close(ARGF.current_file); ARGF.next_p = 1; } diff --git a/test/ruby/test_argf.rb b/test/ruby/test_argf.rb index 9e18a80b40..a6c224ba41 100644 --- a/test/ruby/test_argf.rb +++ b/test/ruby/test_argf.rb @@ -658,16 +658,12 @@ class TestArgf < Test::Unit::TestCase def test_skip ruby('-e', <<-SRC, @t1.path, @t2.path, @t3.path) do |f| - begin - ARGF.skip - rescue - puts "cannot skip" # ??? - end + ARGF.skip puts ARGF.gets ARGF.skip puts ARGF.read SRC - assert_equal("cannot skip\n1\n3\n4\n5\n6\n", f.read) + assert_equal("1\n3\n4\n5\n6\n", f.read) end end diff --git a/version.h b/version.h index 880ac6aacc..dfb1d2037d 100644 --- a/version.h +++ b/version.h @@ -1,6 +1,6 @@ #define RUBY_VERSION "1.9.1" #define RUBY_RELEASE_DATE "2009-05-22" -#define RUBY_PATCHLEVEL 180 +#define RUBY_PATCHLEVEL 181 #define RUBY_VERSION_MAJOR 1 #define RUBY_VERSION_MINOR 9 #define RUBY_VERSION_TEENY 1