ruby-changes:21897
From: usa <ko1@a...>
Date: Mon, 5 Dec 2011 10:27:04 +0900 (JST)
Subject: [ruby-changes:21897] usa:r33946 (trunk): * ext/zlib/zlib.c (rb_gzreader_initialize): revert a part of r33937.
usa 2011-12-05 10:25:47 +0900 (Mon, 05 Dec 2011) New Revision: 33946 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=33946 Log: * 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. Modified files: trunk/ChangeLog trunk/ext/zlib/zlib.c Index: ChangeLog =================================================================== --- ChangeLog (revision 33945) +++ ChangeLog (revision 33946) @@ -1,3 +1,12 @@ +Mon Dec 5 10:18:45 2011 NAKAMURA Usaku <usa@r...> + + * 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 <akr@f...> * lib/tempfile.rb: don't use lock directory. [ruby-dev:39197] Index: ext/zlib/zlib.c =================================================================== --- ext/zlib/zlib.c (revision 33945) +++ ext/zlib/zlib.c (revision 33946) @@ -10,7 +10,6 @@ #include <zlib.h> #include <time.h> #include <ruby/io.h> -#include <fcntl.h> #ifdef HAVE_VALGRIND_MEMCHECK_H # include <valgrind/memcheck.h> @@ -3426,13 +3425,6 @@ 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); -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/