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

ruby-changes:40573

From: nagachika <ko1@a...>
Date: Thu, 19 Nov 2015 00:49:38 +0900 (JST)
Subject: [ruby-changes:40573] nagachika:r52652 (ruby_2_2): merge revision(s) 52016, 52017, 52019, 52020, 52021: [Backport #10735]

nagachika	2015-11-19 00:49:29 +0900 (Thu, 19 Nov 2015)

  New Revision: 52652

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

  Log:
    merge revision(s) 52016,52017,52019,52020,52021: [Backport #10735]
    
    * enc/euc_jp.c (mbc_case_fold): check given string is valid or not,
      and if invalid, return 1. [Bug #11486]

  Modified directories:
    branches/ruby_2_2/
  Modified files:
    branches/ruby_2_2/ChangeLog
    branches/ruby_2_2/enc/euc_jp.c
    branches/ruby_2_2/test/ruby/test_m17n_comb.rb
    branches/ruby_2_2/version.h
Index: ruby_2_2/ChangeLog
===================================================================
--- ruby_2_2/ChangeLog	(revision 52651)
+++ ruby_2_2/ChangeLog	(revision 52652)
@@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_2/ChangeLog#L1
+Thu Nov 19 00:41:09 2015  NARUSE, Yui  <naruse@r...>
+
+	* enc/euc_jp.c (mbc_case_fold): check given string is valid or not,
+	  and if invalid, return 1. [Bug #11486]
+
 Thu Nov 19 00:15:23 2015  Zachary Scott  <zzak@r...>
 
 	* ext/openssl/ossl_pkey.c: Merge ruby/openssl@b9ea8ef [Bug #10735]
Index: ruby_2_2/enc/euc_jp.c
===================================================================
--- ruby_2_2/enc/euc_jp.c	(revision 52651)
+++ ruby_2_2/enc/euc_jp.c	(revision 52652)
@@ -381,8 +381,10 @@ mbc_case_fold(OnigCaseFoldType flag, https://github.com/ruby/ruby/blob/trunk/ruby_2_2/enc/euc_jp.c#L381
     OnigCodePoint code;
     int len;
 
+    len = mbc_enc_len(p, end, enc);
     code = get_lower_case(mbc_to_code(p, end, enc));
     len = code_to_mbc(code, lower, enc);
+    if (len == ONIGERR_INVALID_CODE_POINT_VALUE) len = 1;
     (*pp) += len;
     return len; /* return byte length of converted char to lower */
   }
Index: ruby_2_2/version.h
===================================================================
--- ruby_2_2/version.h	(revision 52651)
+++ ruby_2_2/version.h	(revision 52652)
@@ -1,6 +1,6 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_2/version.h#L1
 #define RUBY_VERSION "2.2.4"
 #define RUBY_RELEASE_DATE "2015-11-19"
-#define RUBY_PATCHLEVEL 190
+#define RUBY_PATCHLEVEL 191
 
 #define RUBY_RELEASE_YEAR 2015
 #define RUBY_RELEASE_MONTH 11
Index: ruby_2_2/test/ruby/test_m17n_comb.rb
===================================================================
--- ruby_2_2/test/ruby/test_m17n_comb.rb	(revision 52651)
+++ ruby_2_2/test/ruby/test_m17n_comb.rb	(revision 52652)
@@ -1635,4 +1635,9 @@ class TestM17NComb < Test::Unit::TestCas https://github.com/ruby/ruby/blob/trunk/ruby_2_2/test/ruby/test_m17n_comb.rb#L1635
     }
   end
 
+  def test_bug11486
+    bug11486 = '[Bug #11486]'
+    assert_nil ("\u3042"*19+"\r"*19+"\u3042"*20+"\r"*20).encode(Encoding::EUC_JP).gsub!(/xxx/i, ""), bug11486
+    assert_match Regexp.new("ABC\uff41".encode(Encoding::EUC_JP), Regexp::IGNORECASE), "abc\uFF21".encode(Encoding::EUC_JP), bug11486
+  end
 end

Property changes on: ruby_2_2
___________________________________________________________________
Modified: svn:mergeinfo
   Merged /trunk:r52016-52017,52019-52021


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

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