1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

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]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_4@61455 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nagachika 2017-12-24 19:14:30 +00:00
parent 8916f02076
commit 58d3ef7778
3 changed files with 7 additions and 1 deletions

View file

@ -3969,6 +3969,7 @@ str_succ(VALUE str)
}
carry_pos = s - sbeg;
}
ENC_CODERANGE_SET(str, ENC_CODERANGE_UNKNOWN);
}
RESIZE_CAPA(str, slen + carry_len);
sbeg = RSTRING_PTR(str);

View file

@ -1660,6 +1660,11 @@ CODE
assert_equal("!", " ".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!

View file

@ -1,6 +1,6 @@
#define RUBY_VERSION "2.4.4"
#define RUBY_RELEASE_DATE "2017-12-25"
#define RUBY_PATCHLEVEL 225
#define RUBY_PATCHLEVEL 226
#define RUBY_RELEASE_YEAR 2017
#define RUBY_RELEASE_MONTH 12