mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* ext/stringio/stringio.c (strio_init): rewind when reopened.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@17103 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
05f4cafde0
commit
f9ac9e2dfc
4 changed files with 22 additions and 3 deletions
|
@ -1,3 +1,7 @@
|
||||||
|
Thu Jun 12 03:20:59 2008 Yusuke Endoh <mame@tsg.ne.jp>
|
||||||
|
|
||||||
|
* ext/stringio/stringio.c (strio_init): rewind when reopened.
|
||||||
|
|
||||||
Thu Jun 12 00:56:20 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
Thu Jun 12 00:56:20 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
* ext/tk: check proper conditions. [ruby-dev:35047]
|
* ext/tk: check proper conditions. [ruby-dev:35047]
|
||||||
|
|
|
@ -269,6 +269,8 @@ strio_init(argc, argv, ptr)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
ptr->string = string;
|
ptr->string = string;
|
||||||
|
ptr->pos = 0;
|
||||||
|
ptr->lineno = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static VALUE
|
static VALUE
|
||||||
|
|
|
@ -40,4 +40,17 @@ class TestStringIO < Test::Unit::TestCase
|
||||||
end
|
end
|
||||||
assert_equal("hacker\nother ruby\n", stringio.string)
|
assert_equal("hacker\nother ruby\n", stringio.string)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def test_reopen
|
||||||
|
f = StringIO.new("foo\nbar\nbaz\n")
|
||||||
|
assert_equal("foo\n", f.gets)
|
||||||
|
f.reopen("qux\nquux\nquuux\n")
|
||||||
|
assert_equal("qux\n", f.gets)
|
||||||
|
|
||||||
|
f2 = StringIO.new("")
|
||||||
|
f2.reopen(f)
|
||||||
|
assert_equal("quux\n", f2.gets)
|
||||||
|
ensure
|
||||||
|
f.close unless f.closed?
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
#define RUBY_VERSION "1.8.7"
|
#define RUBY_VERSION "1.8.7"
|
||||||
#define RUBY_RELEASE_DATE "2008-06-10"
|
#define RUBY_RELEASE_DATE "2008-06-12"
|
||||||
#define RUBY_VERSION_CODE 187
|
#define RUBY_VERSION_CODE 187
|
||||||
#define RUBY_RELEASE_CODE 20080610
|
#define RUBY_RELEASE_CODE 20080612
|
||||||
#define RUBY_PATCHLEVEL 5000
|
#define RUBY_PATCHLEVEL 5000
|
||||||
|
|
||||||
#define RUBY_VERSION_MAJOR 1
|
#define RUBY_VERSION_MAJOR 1
|
||||||
|
@ -9,7 +9,7 @@
|
||||||
#define RUBY_VERSION_TEENY 7
|
#define RUBY_VERSION_TEENY 7
|
||||||
#define RUBY_RELEASE_YEAR 2008
|
#define RUBY_RELEASE_YEAR 2008
|
||||||
#define RUBY_RELEASE_MONTH 6
|
#define RUBY_RELEASE_MONTH 6
|
||||||
#define RUBY_RELEASE_DAY 10
|
#define RUBY_RELEASE_DAY 12
|
||||||
|
|
||||||
#ifdef RUBY_EXTERN
|
#ifdef RUBY_EXTERN
|
||||||
RUBY_EXTERN const char ruby_version[];
|
RUBY_EXTERN const char ruby_version[];
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue