diff options
author | duerst <duerst@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-05-24 23:01:39 +0000 |
---|---|---|
committer | duerst <duerst@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-05-24 23:01:39 +0000 |
commit | eb30aacf92029f2dd6977d421b51a473475d87ae (patch) | |
tree | 13adf866257de865405e83a399ae2d874676a53e /enc | |
parent | a9c8efe196c079a634e11c8212313f63548529c6 (diff) | |
download | ruby-eb30aacf92029f2dd6977d421b51a473475d87ae.tar.gz |
* enc/unicode.c: Fix flag error for switch from titlecase to lowercase.
* test/ruby/enc/test_case_mapping.rb: Tests for above error.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55153 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'enc')
-rw-r--r-- | enc/unicode.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/enc/unicode.c b/enc/unicode.c index 8f978bc9a7..22d1dda809 100644 --- a/enc/unicode.c +++ b/enc/unicode.c @@ -670,6 +670,8 @@ onigenc_unicode_case_map(OnigCaseFoldType* flagP, OnigUChar *to_start = to; OnigCaseFoldType flags = *flagP; to_end -= CASE_MAPPING_SLACK; + /* copy flags ONIGENC_CASE_UPCASE and ONIGENC_CASE_DOWNCASE over to + * ONIGENC_CASE_UP_SPECIAL and ONIGENC_CASE_DOWN_SPECIAL */ flags |= (flags&(ONIGENC_CASE_UPCASE|ONIGENC_CASE_DOWNCASE))<<ONIGENC_CASE_SPECIAL_OFFSET; while (*pp<end && to<=to_end) { @@ -780,7 +782,8 @@ onigenc_unicode_case_map(OnigCaseFoldType* flagP, to += ONIGENC_CODE_TO_MBC(enc, code, to); /* switch from titlecase to lowercase for capitalize */ if (flags & ONIGENC_CASE_TITLECASE) - flags ^= (ONIGENC_CASE_UPCASE|ONIGENC_CASE_TITLECASE|ONIGENC_CASE_DOWNCASE); + flags ^= (ONIGENC_CASE_UPCASE |ONIGENC_CASE_DOWNCASE|ONIGENC_CASE_TITLECASE| + ONIGENC_CASE_UP_SPECIAL|ONIGENC_CASE_DOWN_SPECIAL); } *flagP = flags; return (int)(to-to_start); |