* string.c Change rb_str_casemap to use encoding primitive

case_map instead of directly calling onigenc_unicode_case_map.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55293 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
duerst 2016-06-06 04:37:10 +00:00
parent b09795d803
commit 2f49aa8f62
2 changed files with 6 additions and 12 deletions

View File

@ -1,3 +1,8 @@
Mon Jun 6 13:37:08 2016 Martin Duerst <duerst@it.aoyama.ac.jp>
* string.c Change rb_str_casemap to use encoding primitive
case_map instead of directly calling onigenc_unicode_case_map.
Mon Jun 6 13:16:46 2016 Martin Duerst <duerst@it.aoyama.ac.jp>
* test/ruby/enc/test_case_mapping.rb:

View File

@ -5753,17 +5753,6 @@ check_case_options(int argc, VALUE *argv, OnigCaseFoldType flags)
return flags;
}
/* The following declaration should be moved to an include file rather than
be duplicated here (and in enc/unicode.c), but we'll wait for this because
we want this to become a primitive anyway. */
extern int
onigenc_unicode_case_map(OnigCaseFoldType* flag,
const OnigUChar** pp,
const OnigUChar* end,
OnigUChar* to,
OnigUChar* to_end,
const struct OnigEncodingTypeST* enc);
/* 16 should be long enough to absorb any kind of single character length increase */
#define CASE_MAPPING_ADDITIONAL_LENGTH 20
@ -5800,7 +5789,7 @@ rb_str_casemap(VALUE source, OnigCaseFoldType *flags, rb_encoding *enc)
current_buffer = current_buffer->next;
current_buffer->next = NULL;
current_buffer->capa = capa;
buffer_length_or_invalid = onigenc_unicode_case_map(flags,
buffer_length_or_invalid = enc->case_map(flags,
(const OnigUChar**)&source_current, source_end,
current_buffer->space,
current_buffer->space+current_buffer->capa,