From f307d1fe21371ee27436da79d240ad9ade285257 Mon Sep 17 00:00:00 2001 From: duerst Date: Sun, 17 Jan 2016 11:10:45 +0000 Subject: * 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 --- enc/unicode.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'enc') 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; } } -- cgit v1.2.3