aboutsummaryrefslogtreecommitdiffstats
path: root/enc/unicode.c
diff options
context:
space:
mode:
Diffstat (limited to 'enc/unicode.c')
-rw-r--r--enc/unicode.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/enc/unicode.c b/enc/unicode.c
index 65a8da3c06..82fc877fe6 100644
--- a/enc/unicode.c
+++ b/enc/unicode.c
@@ -2093,16 +2093,16 @@ onigenc_unicode_property_name_to_ctype(OnigEncoding enc, UChar* name, UChar* end
p = name;
len = 0;
- while (p < end) {
+ for (p = name; p < end; p += enclen(enc, p, end)) {
code = ONIGENC_MBC_TO_CODE(enc, p, end);
+ if (code == ' ' || code == '-' || code == '_')
+ continue;
if (code >= 0x80)
return ONIGERR_INVALID_CHAR_PROPERTY_NAME;
- buf[len++] = (UChar )code;
+ buf[len++] = (UChar )TOLOWER((unsigned char)code);
if (len >= PROPERTY_NAME_MAX_SIZE)
return ONIGERR_INVALID_CHAR_PROPERTY_NAME;
-
- p += enclen(enc, p, end);
}
buf[len] = 0;