1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

merges the latter half of r23699 and r23706 from trunk into ruby_1_9_1.

--
* io.c (argf_skip): should close only when current_file is available.
--
* test/ruby/test_argf.rb (TestArgf#test_skip): updated test
  according to clarified behavior.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_1@23790 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
yugui 2009-06-21 09:16:06 +00:00
parent 745dcf0915
commit b00a819511
4 changed files with 13 additions and 8 deletions

View file

@ -1,3 +1,12 @@
Wed Jun 17 00:31:30 2009 Yukihiro Matsumoto <matz@ruby-lang.org>
* test/ruby/test_argf.rb (TestArgf#test_skip): updated test
according to clarified behavior.
Tue Jun 16 06:40:31 2009 Yukihiro Matsumoto <matz@ruby-lang.org>
* io.c (argf_skip): should close only when current_file is available.
Mon Jun 15 22:35:31 2009 Tadayoshi Funaba <tadf@dotrb.org>
* bignum.c (rb_big2db): (-Float::MAX.to_i*2).to_f should return

2
io.c
View file

@ -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;
}

View file

@ -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

View file

@ -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