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

ruby-changes:36697

From: nobu <ko1@a...>
Date: Fri, 12 Dec 2014 10:32:41 +0900 (JST)
Subject: [ruby-changes:36697] nobu:r48778 (trunk): string.c: term fill

nobu	2014-12-12 10:32:36 +0900 (Fri, 12 Dec 2014)

  New Revision: 48778

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

  Log:
    string.c: term fill
    
    * string.c (rb_str_justify): fill wchar terminator.

  Modified files:
    trunk/string.c
Index: string.c
===================================================================
--- string.c	(revision 48777)
+++ string.c	(revision 48778)
@@ -7820,7 +7820,7 @@ rb_str_justify(int argc, VALUE *argv, VA https://github.com/ruby/ruby/blob/trunk/string.c#L7820
            p += rlen2;
 	}
     }
-    *p = '\0';
+    TERM_FILL(p, rb_enc_mbminlen(enc));
     STR_SET_LEN(res, p-RSTRING_PTR(res));
     OBJ_INFECT(res, str);
     if (!NIL_P(pad)) OBJ_INFECT(res, pad);

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

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