summaryrefslogtreecommitdiff
path: root/symbol.c
diff options
context:
space:
mode:
authorNobuyoshi Nakada <[email protected]>2023-11-29 14:40:21 +0900
committerNobuyoshi Nakada <[email protected]>2023-11-29 14:40:21 +0900
commit79eb75a8dd64848f23e9efc465f06326b5d4b680 (patch)
treeb0c1aa74f3cf5d226c36d4a78c455c9ccee1c149 /symbol.c
parentbd2b6b702cf43fb25562bdf8b1929d06ed3fcd98 (diff)
[Bug #20025] Check if upper/lower before fallback to case-folding
Diffstat (limited to 'symbol.c')
-rw-r--r--symbol.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/symbol.c b/symbol.c
index 2447b1ec10..6a0c926db8 100644
--- a/symbol.c
+++ b/symbol.c
@@ -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;