diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-08-07 04:59:27 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-08-07 04:59:27 +0000 |
commit | a438fce7e349c38fc9d0136da79806c2adf357ba (patch) | |
tree | a833b72617c7f453f406209681122e6756154f44 /ext/pathname | |
parent | fd0485acf7936e865903d643715433a7b861afbb (diff) | |
download | ruby-a438fce7e349c38fc9d0136da79806c2adf357ba.tar.gz |
* ext/pathname/pathname.c (path_sub_ext): don't clobber shared string.
[ruby-core:31640]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28896 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/pathname')
-rw-r--r-- | ext/pathname/pathname.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/ext/pathname/pathname.c b/ext/pathname/pathname.c index d62cbdd83e..5dc846a2ed 100644 --- a/ext/pathname/pathname.c +++ b/ext/pathname/pathname.c @@ -192,7 +192,7 @@ path_sub_ext(VALUE self, VALUE repl) ext += extlen; } str2 = rb_str_dup(str); - rb_str_set_len(str2, ext-p); + rb_str_resize(str2, ext-p); rb_str_append(str2, repl); OBJ_INFECT(str2, str); return rb_class_new_instance(1, &str2, rb_obj_class(self)); |