diff options
| author | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-09-10 22:54:01 +0000 |
|---|---|---|
| committer | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-09-10 22:54:01 +0000 |
| commit | 72745f67aa0c51e38d8424e1cb4c6d62d8a671c3 (patch) | |
| tree | c365ce9fa86e8f507df68c5c616066e7fdea8d02 /enc/unicode.c | |
| parent | 4ccd215cd379f74311525aa2d867b4beef963201 (diff) | |
| download | ruby-72745f67aa0c51e38d8424e1cb4c6d62d8a671c3.tar.gz ruby-72745f67aa0c51e38d8424e1cb4c6d62d8a671c3.tar.xz ruby-72745f67aa0c51e38d8424e1cb4c6d62d8a671c3.zip | |
* 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: http://svn.ruby-lang.org/repos/ruby/trunk@24836 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'enc/unicode.c')
| -rw-r--r-- | enc/unicode.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/enc/unicode.c b/enc/unicode.c index 65a8da3c0..82fc877fe 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; |
