diff options
author | Nobuyoshi Nakada <[email protected]> | 2023-11-29 14:40:21 +0900 |
---|---|---|
committer | Nobuyoshi Nakada <[email protected]> | 2023-11-29 14:40:21 +0900 |
commit | 79eb75a8dd64848f23e9efc465f06326b5d4b680 (patch) | |
tree | b0c1aa74f3cf5d226c36d4a78c455c9ccee1c149 /symbol.c | |
parent | bd2b6b702cf43fb25562bdf8b1929d06ed3fcd98 (diff) |
[Bug #20025] Check if upper/lower before fallback to case-folding
Diffstat (limited to 'symbol.c')
-rw-r--r-- | symbol.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -225,10 +225,10 @@ rb_sym_constant_char_p(const char *name, long nlen, rb_encoding *enc) if (!MBCLEN_CHARFOUND_P(c)) return FALSE; len = MBCLEN_CHARFOUND_LEN(c); c = rb_enc_mbc_to_codepoint(name, end, enc); + if (rb_enc_isupper(c, enc)) return TRUE; + if (rb_enc_islower(c, enc)) return FALSE; if (ONIGENC_IS_UNICODE(enc)) { static int ctype_titlecase = 0; - if (rb_enc_isupper(c, enc)) return TRUE; - if (rb_enc_islower(c, enc)) return FALSE; if (!ctype_titlecase) { static const UChar cname[] = "titlecaseletter"; static const UChar *const end = cname + sizeof(cname) - 1; |