diff --git a/ChangeLog b/ChangeLog index a49a395737..23e4c8d00b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -31,7 +31,7 @@ Wed Sep 17 01:33:11 2008 Tanaka Akira * regexec.c (string_cmp_ic): add text_end argument. (match_at): check end of character after exact string matches. - * enc/utf_8.c (graphme_table): defined for extended graphme cluster + * enc/utf_8.c (grapheme_table): defined for extended grapheme cluster boundary. (grapheme_cmp): defined. (get_grapheme_properties): defined. @@ -41,7 +41,7 @@ Wed Sep 17 01:33:11 2008 Tanaka Akira (mbc_to_code0): extracted from mbc_to_code. (mbc_to_code): use mbc_to_code0. (left_adjust_combchar_head): defined. - (utf_8): use a extended graphme cluster as a unit. + (utf_8): use a extended grapheme cluster as a unit. * enc/unicode.c (onigenc_unicode_mbc_case_fold): use ONIGENC_MBC_PRECISE_CODEPOINT to extract codepoints. diff --git a/enc/utf_8.c b/enc/utf_8.c index 24f5fab2e0..5913e786a2 100644 --- a/enc/utf_8.c +++ b/enc/utf_8.c @@ -255,11 +255,11 @@ static OnigCodePoint mbc_to_code(const UChar* p, const UChar* end, int *precise_ #define GRAPHEME_BIT_T 0x040 #define GRAPHEME_BIT_LV 0x080 #define GRAPHEME_BIT_LVT 0x100 -const struct graphme_table_t { /* codepoint_min <= c < codepoint_min+num_codepoints */ +const struct grapheme_table_t { /* codepoint_min <= c < codepoint_min+num_codepoints */ OnigCodePoint codepoint_min; unsigned short num_codepoints; unsigned short properties; -} graphme_table[] = { +} grapheme_table[] = { {0x00000,32,0x001}, {0x0007F,33,0x001}, {0x000AD,1,0x001}, {0x00300,112,0x002}, {0x00483,7,0x002}, {0x00591,45,0x002}, @@ -801,8 +801,8 @@ const struct graphme_table_t { /* codepoint_min <= c < codepoint_min+num_codepoi static int grapheme_cmp(const void *p1, const void *p2) { - const struct graphme_table_t *k = p1; - const struct graphme_table_t *v = p2; + const struct grapheme_table_t *k = p1; + const struct grapheme_table_t *v = p2; OnigCodePoint c = k->codepoint_min; if (c < v->codepoint_min) return -1; @@ -814,10 +814,10 @@ grapheme_cmp(const void *p1, const void *p2) static unsigned int get_grapheme_properties(OnigCodePoint c) { - struct graphme_table_t key, *found; + struct grapheme_table_t key, *found; key.codepoint_min = c; - found = bsearch(&key, graphme_table, sizeof(graphme_table)/sizeof(*graphme_table), - sizeof(*graphme_table), grapheme_cmp); + found = bsearch(&key, grapheme_table, sizeof(grapheme_table)/sizeof(*grapheme_table), + sizeof(*grapheme_table), grapheme_cmp); if (found) return found->properties; return 0;