diff options
| author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-05-14 16:35:30 +0000 |
|---|---|---|
| committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-05-14 16:35:30 +0000 |
| commit | 75bc427c7be219761889db3e66187953dbef1d97 (patch) | |
| tree | 2aa48325d5a89004997add9617e3e9967e5ea7c8 /string.c | |
| parent | 1914500fd8435803d546d9a256683ba82f416a02 (diff) | |
| download | ruby-75bc427c7be219761889db3e66187953dbef1d97.tar.gz ruby-75bc427c7be219761889db3e66187953dbef1d97.tar.xz ruby-75bc427c7be219761889db3e66187953dbef1d97.zip | |
* range.c (range_each_func): terminates loop if generating value
is same to @end. [ruby-talk:100269]
* string.c (rb_str_new4): should not reuse frozen shared string if
the original is not an instance of String. [ruby-talk:100193]
git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8@6312 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'string.c')
| -rw-r--r-- | string.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -164,7 +164,7 @@ rb_str_new4(orig) if (OBJ_FROZEN(orig)) return orig; klass = rb_obj_class(orig); - if (FL_TEST(orig, ELTS_SHARED) && RSTRING(orig)->aux.shared) { + if (FL_TEST(orig, ELTS_SHARED) && (str = RSTRING(orig)->aux.shared) && klass == RBASIC(str)->klass) { long ofs; str = RSTRING(orig)->aux.shared; ofs = RSTRING(str)->len - RSTRING(orig)->len; |
