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

ruby-changes:50021

From: usa <ko1@a...>
Date: Wed, 31 Jan 2018 22:30:22 +0900 (JST)
Subject: [ruby-changes:50021] usa:r62139 (ruby_2_3): merge revision(s) 60066: [Backport #13952]

usa	2018-01-31 22:30:15 +0900 (Wed, 31 Jan 2018)

  New Revision: 62139

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

  Log:
    merge revision(s) 60066: [Backport #13952]
    
    string.c: fix ASCII-only on succ
    
    * string.c (str_succ): clear coderange cache when no alpha-numeric
      character case, carried part may become ASCII-only.
      [ruby-core:83062] [Bug #13952]

  Modified directories:
    branches/ruby_2_3/
  Modified files:
    branches/ruby_2_3/ChangeLog
    branches/ruby_2_3/string.c
    branches/ruby_2_3/test/ruby/test_string.rb
    branches/ruby_2_3/version.h
Index: ruby_2_3/version.h
===================================================================
--- ruby_2_3/version.h	(revision 62138)
+++ ruby_2_3/version.h	(revision 62139)
@@ -1,6 +1,6 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_3/version.h#L1
 #define RUBY_VERSION "2.3.7"
 #define RUBY_RELEASE_DATE "2018-01-31"
-#define RUBY_PATCHLEVEL 400
+#define RUBY_PATCHLEVEL 401
 
 #define RUBY_RELEASE_YEAR 2018
 #define RUBY_RELEASE_MONTH 1
Index: ruby_2_3/ChangeLog
===================================================================
--- ruby_2_3/ChangeLog	(revision 62138)
+++ ruby_2_3/ChangeLog	(revision 62139)
@@ -1,3 +1,11 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_3/ChangeLog#L1
+Wed Jan 31 22:29:57 2018  Nobuyoshi Nakada  <nobu@r...>
+
+	string.c: fix ASCII-only on succ
+
+	* string.c (str_succ): clear coderange cache when no alpha-numeric
+	  character case, carried part may become ASCII-only.
+	  [ruby-core:83062] [Bug #13952]
+
 Wed Jan 31 22:28:20 2018  Nobuyoshi Nakada  <nobu@r...>
 
 	pack.c: unpack "M" may be ASCII only
Index: ruby_2_3/string.c
===================================================================
--- ruby_2_3/string.c	(revision 62138)
+++ ruby_2_3/string.c	(revision 62139)
@@ -3700,6 +3700,7 @@ str_succ(VALUE str) https://github.com/ruby/ruby/blob/trunk/ruby_2_3/string.c#L3700
             }
             carry_pos = s - sbeg;
 	}
+	ENC_CODERANGE_SET(str, ENC_CODERANGE_UNKNOWN);
     }
     RESIZE_CAPA(str, slen + carry_len);
     sbeg = RSTRING_PTR(str);
Index: ruby_2_3/test/ruby/test_string.rb
===================================================================
--- ruby_2_3/test/ruby/test_string.rb	(revision 62138)
+++ ruby_2_3/test/ruby/test_string.rb	(revision 62139)
@@ -1540,6 +1540,11 @@ class TestString < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/ruby_2_3/test/ruby/test_string.rb#L1540
     assert_equal("2000aaa", "1999zzz".succ)
     assert_equal("AAAA0000", "ZZZ9999".succ)
     assert_equal("**+", "***".succ)
+
+    bug = '[ruby-core:83062] [Bug #13952]'
+    s = "\xff".b
+    assert_not_predicate(s, :ascii_only?)
+    assert_predicate(s.succ, :ascii_only?, bug)
   end
 
   def test_succ!
Index: ruby_2_3
===================================================================
--- ruby_2_3	(revision 62138)
+++ ruby_2_3	(revision 62139)

Property changes on: ruby_2_3
___________________________________________________________________
Modified: svn:mergeinfo
## -0,0 +0,1 ##
   Merged /trunk:r60066

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

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