aboutsummaryrefslogtreecommitdiffstats
path: root/enc/unicode.c
diff options
context:
space:
mode:
authornaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-09-10 22:54:01 +0000
committernaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-09-10 22:54:01 +0000
commitee4b59a4191ecabc1a9d396e234f20be5e5e9f8c (patch)
treec365ce9fa86e8f507df68c5c616066e7fdea8d02 /enc/unicode.c
parente519c9d960549163c17571689cc977f7ca45073e (diff)
downloadruby-ee4b59a4191ecabc1a9d396e234f20be5e5e9f8c.tar.gz
* unicode.c (onigenc_unicode_property_name_to_ctype):
ignore case of properties. * tool/enc-unicode.rb: downcase properties list. * enc/unicode/name2ctype.h, enc/unicode/name2ctype.h.blt, enc/unicode/name2ctype.kwd, enc/unicode/name2ctype.src: follow above. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24836 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
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;