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

ruby-changes:33500

From: nobu <ko1@a...>
Date: Mon, 14 Apr 2014 14:33:46 +0900 (JST)
Subject: [ruby-changes:33500] nobu:r45581 (trunk): string.c: keep source code range

nobu	2014-04-14 14:33:40 +0900 (Mon, 14 Apr 2014)

  New Revision: 45581

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

  Log:
    string.c: keep source code range
    
    * string.c (rb_enc_cr_str_buf_cat): keep code range of the source
      string even if code range of the destination string is unknown.
      no reason to the former is affected by the latter.

  Modified files:
    trunk/string.c
Index: string.c
===================================================================
--- string.c	(revision 45580)
+++ string.c	(revision 45581)
@@ -2090,9 +2090,7 @@ rb_enc_cr_str_buf_cat(VALUE str, const c https://github.com/ruby/ruby/blob/trunk/string.c#L2090
     str_cr = RSTRING_LEN(str) ? ENC_CODERANGE(str) : ENC_CODERANGE_7BIT;
 
     if (str_encindex == ptr_encindex) {
-        if (str_cr == ENC_CODERANGE_UNKNOWN)
-            ptr_cr = ENC_CODERANGE_UNKNOWN;
-        else if (ptr_cr == ENC_CODERANGE_UNKNOWN) {
+	if (str_cr != ENC_CODERANGE_UNKNOWN && ptr_cr == ENC_CODERANGE_UNKNOWN) {
             ptr_cr = coderange_scan(ptr, len, rb_enc_from_index(ptr_encindex));
         }
     }

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

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