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

ruby-changes:29919

From: nobu <ko1@a...>
Date: Mon, 15 Jul 2013 02:41:42 +0900 (JST)
Subject: [ruby-changes:29919] nobu:r41971 (trunk): string.c: char length

nobu	2013-07-15 02:40:32 +0900 (Mon, 15 Jul 2013)

  New Revision: 41971

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

  Log:
    string.c: char length
    
    * string.c (str_null_char): calculate char length.  fix commit miss at
      r41967.

  Modified files:
    trunk/string.c

Index: string.c
===================================================================
--- string.c	(revision 41970)
+++ string.c	(revision 41971)
@@ -1494,10 +1494,9 @@ zero_filled(const char *s, int n) https://github.com/ruby/ruby/blob/trunk/string.c#L1494
 static const char *
 str_null_char(const char *s, long len, const int minlen, rb_encoding *enc)
 {
-    int n;
     const char *e = s + len;
 
-    for (; s + minlen <= e; s += n) {
+    for (; s + minlen <= e; s += rb_enc_mbclen(s, e, enc)) {
 	if (zero_filled(s, minlen)) return s;
     }
     return 0;

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

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