Avoid negative character

Better fix for k-takata/Onigmo#107.

85393e4a63
This commit is contained in:
K.Takata 2019-01-25 18:58:59 +09:00 committed by Nobuyoshi Nakada
parent daf0d6c686
commit 54b963956b
Notes: git 2025-10-31 11:50:38 +00:00
2 changed files with 4 additions and 6 deletions

View File

@ -687,10 +687,8 @@ onigenc_unicode_case_map(OnigCaseFoldType* flagP,
MODIFIED;
if (flags & ONIGENC_CASE_FOLD_TURKISH_AZERI && code == 'i')
code = I_WITH_DOT_ABOVE;
else {
code -= 'a';
code += 'A';
}
else
code -= 'a' - 'A';
}
}
else if (code >= 'A' && code <= 'Z') {

View File

@ -984,7 +984,7 @@ onigenc_ascii_only_case_map(OnigCaseFoldType* flagP, const OnigUChar** pp, const
if (code >= 'a' && code <= 'z' && (flags & ONIGENC_CASE_UPCASE)) {
flags |= ONIGENC_CASE_MODIFIED;
code += 'A' - 'a';
code -= 'a' - 'A';
}
else if (code >= 'A' && code <= 'Z' &&
(flags & (ONIGENC_CASE_DOWNCASE | ONIGENC_CASE_FOLD))) {
@ -1013,7 +1013,7 @@ onigenc_single_byte_ascii_only_case_map(OnigCaseFoldType* flagP, const OnigUChar
if (code >= 'a' && code <= 'z' && (flags & ONIGENC_CASE_UPCASE)) {
flags |= ONIGENC_CASE_MODIFIED;
code += 'A' - 'a';
code -= 'a' - 'A';
}
else if (code >= 'A' && code <= 'Z' &&
(flags & (ONIGENC_CASE_DOWNCASE | ONIGENC_CASE_FOLD))) {