[前][次][番号順一覧][スレッド一覧]

ruby-changes:13753

From: yugui <ko1@a...>
Date: Thu, 29 Oct 2009 01:11:55 +0900 (JST)
Subject: [ruby-changes:13753] Ruby:r25548 (ruby_1_9_1): merges r24704 from trunk into ruby_1_9_1.

yugui	2009-10-29 01:11:37 +0900 (Thu, 29 Oct 2009)

  New Revision: 25548

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=25548

  Log:
    merges r24704 from trunk into ruby_1_9_1.
    --
    * ext/zlib/zlib.c (gzfile_read_all): use gzfile_newstr;
      set and convert its encoding. [ruby-dev:38304]

  Modified files:
    branches/ruby_1_9_1/ChangeLog
    branches/ruby_1_9_1/ext/zlib/zlib.c
    branches/ruby_1_9_1/test/zlib/test_zlib.rb
    branches/ruby_1_9_1/version.h

Index: ruby_1_9_1/ChangeLog
===================================================================
--- ruby_1_9_1/ChangeLog	(revision 25547)
+++ ruby_1_9_1/ChangeLog	(revision 25548)
@@ -1,3 +1,8 @@
+Sun Aug 30 01:15:31 2009  NARUSE, Yui  <naruse@r...>
+
+	* ext/zlib/zlib.c (gzfile_read_all): use gzfile_newstr;
+	  set and convert its encoding. [ruby-dev:38304]
+
 Thu Aug 27 18:31:07 2009  Nobuyoshi Nakada  <nobu@r...>
 
 	* vm_method.c (rb_remove_method_id): exported.
Index: ruby_1_9_1/ext/zlib/zlib.c
===================================================================
--- ruby_1_9_1/ext/zlib/zlib.c	(revision 25547)
+++ ruby_1_9_1/ext/zlib/zlib.c	(revision 25548)
@@ -2198,7 +2198,7 @@
     dst = zstream_detach_buffer(&gz->z);
     gzfile_calc_crc(gz, dst);
     OBJ_TAINT(dst);
-    return dst;
+    return gzfile_newstr(gz, dst);
 }
 
 static VALUE
Index: ruby_1_9_1/version.h
===================================================================
--- ruby_1_9_1/version.h	(revision 25547)
+++ ruby_1_9_1/version.h	(revision 25548)
@@ -1,5 +1,5 @@
 #define RUBY_VERSION "1.9.1"
-#define RUBY_PATCHLEVEL 306
+#define RUBY_PATCHLEVEL 307
 #define RUBY_VERSION_MAJOR 1
 #define RUBY_VERSION_MINOR 9
 #define RUBY_VERSION_TEENY 1
Index: ruby_1_9_1/test/zlib/test_zlib.rb
===================================================================
--- ruby_1_9_1/test/zlib/test_zlib.rb	(revision 25547)
+++ ruby_1_9_1/test/zlib/test_zlib.rb	(revision 25548)
@@ -442,10 +442,12 @@
     def test_read
       t = Tempfile.new("test_zlib_gzip_reader")
       t.close
-      Zlib::GzipWriter.open(t.path) {|gz| gz.print("foobar") }
+      str = "\u3042\u3044\u3046"
+      Zlib::GzipWriter.open(t.path) {|gz| gz.print(str) }
 
-      f = Zlib::GzipReader.open(t.path)
+      f = Zlib::GzipReader.open(t.path, encoding: "UTF-8")
       assert_raise(ArgumentError) { f.read(-1) }
+      assert_equal(str, f.read)
     end
 
     def test_readpartial

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]