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

ruby-changes:2788

From: ko1@a...
Date: 18 Dec 2007 02:00:28 +0900
Subject: [ruby-changes:2788] matz - Ruby:r14279 (trunk): * sprintf.c (rb_str_format): need to clear output buffer to avoid

matz	2007-12-18 01:50:17 +0900 (Tue, 18 Dec 2007)

  New Revision: 14279

  Modified files:
    trunk/ChangeLog
    trunk/sprintf.c

  Log:
    * sprintf.c (rb_str_format): need to clear output buffer to avoid
      broken encoding compatibility check.

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/ChangeLog?r1=14279&r2=14278
  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/sprintf.c?r1=14279&r2=14278

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 14278)
+++ ChangeLog	(revision 14279)
@@ -1,3 +1,8 @@
+Tue Dec 18 01:46:48 2007  Yukihiro Matsumoto  <matz@r...>
+
+	* sprintf.c (rb_str_format): need to clear output buffer to avoid
+	  broken encoding compatibility check.
+
 Tue Dec 18 01:40:20 2007  Nobuyoshi Nakada  <nobu@r...>
 
 	* lib/mkmf.rb (depend_rules): inserts ruby to only headers.
Index: sprintf.c
===================================================================
--- sprintf.c	(revision 14278)
+++ sprintf.c	(revision 14279)
@@ -298,6 +298,7 @@
     result = rb_str_buf_new(bsiz);
     rb_enc_copy(result, fmt);
     buf = RSTRING_PTR(result);
+    memset(buf, 0, bsiz);
 
     for (; p < end; p++) {
 	const char *t;
@@ -850,7 +851,6 @@
     rb_str_resize(result, blen);
 
     if (tainted) OBJ_TAINT(result);
-    rb_enc_associate(result, enc);
     return result;
 }
 

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

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