mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
zlib.c: return unshared string
* ext/zlib/zlib.c (zstream_shift_buffer): create new copied string since it cannot be shared ever. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45625 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
39fe6aa304
commit
549e0e488e
1 changed files with 1 additions and 2 deletions
|
@ -814,8 +814,7 @@ zstream_shift_buffer(struct zstream *z, long len)
|
|||
return zstream_detach_buffer(z);
|
||||
}
|
||||
|
||||
dst = rb_str_subseq(z->buf, 0, len);
|
||||
rb_obj_reveal(dst, rb_cString);
|
||||
dst = rb_str_new(RSTRING_PTR(z->buf), len);
|
||||
z->buf_filled -= len;
|
||||
memmove(RSTRING_PTR(z->buf), RSTRING_PTR(z->buf) + len,
|
||||
z->buf_filled);
|
||||
|
|
Loading…
Reference in a new issue