From 243faf286f072f0c45d353e03effc0a531e5df52 Mon Sep 17 00:00:00 2001 From: yugui Date: Thu, 23 Dec 2010 12:45:26 +0000 Subject: merges r30122 from trunk into ruby_1_9_2. -- * io.c (io_read): duplicate string if shared. [ruby-dev:42719] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_2@30317 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 4 ++++ io.c | 5 ++++- version.h | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 2e9c65f888..852f43a1c6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +Tue Dec 7 22:37:15 2010 Masaya Tarui + + * io.c (io_read): duplicate string if shared. [ruby-dev:42719] + Tue Dec 7 21:59:37 2010 Kouhei Sutou * lib/rexml/light/node.rb: remove circular require. diff --git a/io.c b/io.c index 79c3024538..474562a944 100644 --- a/io.c +++ b/io.c @@ -2157,7 +2157,10 @@ io_read(int argc, VALUE *argv, VALUE io) rb_scan_args(argc, argv, "02", &length, &str); if (NIL_P(length)) { - if (!NIL_P(str)) StringValue(str); + if (!NIL_P(str)){ + StringValue(str); + rb_str_modify(str); + } GetOpenFile(io, fptr); rb_io_check_char_readable(fptr); return read_all(fptr, remain_size(fptr), str); diff --git a/version.h b/version.h index d96f840a0d..556c99046b 100644 --- a/version.h +++ b/version.h @@ -1,5 +1,5 @@ #define RUBY_VERSION "1.9.2" -#define RUBY_PATCHLEVEL 122 +#define RUBY_PATCHLEVEL 123 #define RUBY_VERSION_MAJOR 1 #define RUBY_VERSION_MINOR 9 #define RUBY_VERSION_TEENY 1 -- cgit v1.2.3