mirror of
https://github.com/ruby/ruby.git
synced 2026-01-26 12:14:51 +00:00
Avoid negative character
Better fix for k-takata/Onigmo#107.
85393e4a63
This commit is contained in:
parent
daf0d6c686
commit
54b963956b
Notes:
git
2025-10-31 11:50:38 +00:00
@ -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') {
|
||||
|
||||
4
regenc.c
4
regenc.c
@ -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))) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user