aboutsummaryrefslogtreecommitdiffstats
path: root/enc/unicode.c
diff options
context:
space:
mode:
authorduerst <duerst@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-01-17 11:10:45 +0000
committerduerst <duerst@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-01-17 11:10:45 +0000
commitf307d1fe21371ee27436da79d240ad9ade285257 (patch)
treea0ce6d1776115ac0d8eaa7c1fdbb37dc3df7c595 /enc/unicode.c
parent39f44f0113d3051f7d589414d0877d8dfda669b8 (diff)
downloadruby-f307d1fe21371ee27436da79d240ad9ade285257.tar.gz
* enc/unicode.c: Fixed a logical error and some comments.
* test/ruby/enc/test_case_mapping.rb: Made tests more general. (with Kimihito Matsui) git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53564 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'enc/unicode.c')
-rw-r--r--enc/unicode.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/enc/unicode.c b/enc/unicode.c
index 9fd3fe10ba..086fe14494 100644
--- a/enc/unicode.c
+++ b/enc/unicode.c
@@ -643,10 +643,10 @@ onigenc_unicode_case_map(OnigCaseFoldType* flagP,
}
}
else if (code>=0x00C0) { /* deal with non-ASCII; nothing relevant below U+00C0 */
- if (code==0x0130) { /* I WITH DOT ABOVE -> i */
- if (flags&ONIGENC_CASE_UPCASE) {
+ if (code==0x0130) {
+ if (flags&ONIGENC_CASE_DOWNCASE) {
if (flags&ONIGENC_CASE_FOLD_TURKISH_AZERI)
- code = 0x0069;
+ code = 0x0069; /* I WITH DOT ABOVE -> i */
else { /* make dot above explicit */
to += ONIGENC_CODE_TO_MBC(enc, 0x0069, to);
code = 0x0307; /* dot above */
@@ -656,7 +656,7 @@ onigenc_unicode_case_map(OnigCaseFoldType* flagP,
}
/* the following case can be removed once we rely on data,
* because the mapping is always the same */
- else if (code==0x0131 && flags&ONIGENC_CASE_UPCASE) { /* DOTLESS i -> I */
+ else if (code==0x0131 && (flags&ONIGENC_CASE_UPCASE)) { /* DOTLESS i -> I */
code = 0x0049; MODIFIED;
}
}