Skip to content

Fix for Ruby 2.1 #25

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions ext/bzip2/reader.c
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,6 @@ VALUE bz_reader_read(int argc, VALUE *argv, VALUE obj) {
OBJ_TAINT(res);
}
if (n == 0) {
free(bzf->buf);
return res;
}
while (1) {
Expand All @@ -326,14 +325,12 @@ VALUE bz_reader_read(int argc, VALUE *argv, VALUE obj) {
res = rb_str_cat(res, bzf->bzs.next_out, n);
bzf->bzs.next_out += n;
bzf->bzs.avail_out -= n;
free(bzf->buf);
return res;
}
if (total) {
res = rb_str_cat(res, bzf->bzs.next_out, total);
}
if (bz_next_available(bzf, 0) == BZ_STREAM_END) {
free(bzf->buf);
return res;
}
}
Expand Down
5 changes: 0 additions & 5 deletions ext/bzip2/writer.c
Original file line number Diff line number Diff line change
Expand Up @@ -161,11 +161,6 @@ VALUE bz_writer_close(VALUE obj) {

Get_BZ2(obj, bzf);
res = bz_writer_internal_close(bzf);
#ifndef RUBINIUS
if (!NIL_P(res) && (bzf->flags & BZ2_RB_INTERNAL)) {
RBASIC(res)->klass = rb_cString;
}
#endif
return res;
}

Expand Down