From 8229b9dd3f57a965872734f2b97f98a512979560 Mon Sep 17 00:00:00 2001 From: usa Date: Mon, 5 Dec 2011 01:25:47 +0000 Subject: * ext/zlib/zlib.c (rb_gzreader_initialize): revert a part of r33937. 1st, to change the mode of an IO is very sensitive problem, so the maintainer of this library should judge it. 2nd, usually Zlib::GzReader.new is not called directly. #initialize is called via .open, and in the method the I/O is opened in binary mode, so there is no problem without changing the mode in #initialize. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33946 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 9 +++++++++ ext/zlib/zlib.c | 8 -------- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/ChangeLog b/ChangeLog index a709cba33a..e58e95cce3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +Mon Dec 5 10:18:45 2011 NAKAMURA Usaku + + * ext/zlib/zlib.c (rb_gzreader_initialize): revert a part of r33937. + 1st, to change the mode of an IO is very sensitive problem, so + the maintainer of this library should judge it. + 2nd, usually Zlib::GzReader.new is not called directly. #initialize + is called via .open, and in the method the I/O is opened in binary + mode, so there is no problem without changing the mode in #initialize. + Sun Dec 4 22:53:12 2011 Tanaka Akira * lib/tempfile.rb: don't use lock directory. [ruby-dev:39197] diff --git a/ext/zlib/zlib.c b/ext/zlib/zlib.c index 073883bc05..a235cbb621 100644 --- a/ext/zlib/zlib.c +++ b/ext/zlib/zlib.c @@ -10,7 +10,6 @@ #include #include #include -#include #ifdef HAVE_VALGRIND_MEMCHECK_H # include @@ -3426,13 +3425,6 @@ rb_gzreader_initialize(int argc, VALUE *argv, VALUE obj) Data_Get_Struct(obj, struct gzfile, gz); rb_scan_args(argc, argv, "1:", &io, &opt); -#ifdef O_BINARY - if (BUILTIN_TYPE(io) == T_FILE) { - rb_io_t *fptr; - GetOpenFile(io, fptr); - setmode(fptr->fd, O_BINARY); - } -#endif /* this is undocumented feature of zlib */ err = inflateInit2(&gz->z.stream, -MAX_WBITS); -- cgit v1.2.3