From cd7fbc20953e3c738dd31d61d26582b196d0af84 Mon Sep 17 00:00:00 2001 From: duerst Date: Sun, 17 Jan 2016 11:40:46 +0000 Subject: * string.c: Any kind of option is now taking the new code path for upcase/downcase/capitalize/swapcase. :lithuanian can be used for testing if no specific option is desired. * test/ruby/enc/test_case_mapping.rb: Adjusted to above. (with Kimihito Matsui) git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53565 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- string.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'string.c') diff --git a/string.c b/string.c index da2030efb9..3267b28664 100644 --- a/string.c +++ b/string.c @@ -5734,7 +5734,7 @@ rb_str_upcase_bang(int argc, VALUE *argv, VALUE str) enc = STR_ENC_GET(str); rb_str_check_dummy_enc(enc); s = RSTRING_PTR(str); send = RSTRING_END(str); - if (enc==rb_utf8_encoding() && flags&ONIGENC_CASE_FOLD_LITHUANIAN) { /* lithuanian temporarily used as a guard for debugging */ + if (enc==rb_utf8_encoding() && argc>0) { /* :lithuanian can temporarily be used for new functionality without options */ str_shared_replace(str, rb_str_casemap(str, &flags, enc)); modify = ONIGENC_CASE_MODIFIED & flags; } @@ -5821,7 +5821,7 @@ rb_str_downcase_bang(int argc, VALUE *argv, VALUE str) enc = STR_ENC_GET(str); rb_str_check_dummy_enc(enc); s = RSTRING_PTR(str); send = RSTRING_END(str); - if (enc==rb_utf8_encoding() && flags&ONIGENC_CASE_FOLD_LITHUANIAN) { /* lithuanian temporarily used as a guard for debugging */ + if (enc==rb_utf8_encoding() && argc>0) { /* :lithuanian can temporarily be used for new functionality without options */ str_shared_replace(str, rb_str_casemap(str, &flags, enc)); modify = ONIGENC_CASE_MODIFIED & flags; } @@ -5917,7 +5917,7 @@ rb_str_capitalize_bang(int argc, VALUE *argv, VALUE str) enc = STR_ENC_GET(str); rb_str_check_dummy_enc(enc); if (RSTRING_LEN(str) == 0 || !RSTRING_PTR(str)) return Qnil; - if (enc==rb_utf8_encoding() && flags&ONIGENC_CASE_FOLD_LITHUANIAN) { /* lithuanian temporarily used as a guard for debugging */ + if (enc==rb_utf8_encoding() && argc>0) { /* :lithuanian can temporarily be used for new functionality without options */ str_shared_replace(str, rb_str_casemap(str, &flags, enc)); modify = ONIGENC_CASE_MODIFIED & flags; } @@ -5989,7 +5989,7 @@ rb_str_swapcase_bang(int argc, VALUE *argv, VALUE str) enc = STR_ENC_GET(str); rb_str_check_dummy_enc(enc); s = RSTRING_PTR(str); send = RSTRING_END(str); - if (enc==rb_utf8_encoding() && flags&ONIGENC_CASE_FOLD_LITHUANIAN) { /* lithuanian temporarily used as a guard for debugging */ + if (enc==rb_utf8_encoding() && argc>0) { /* :lithuanian can temporarily be used for new functionality without options */ str_shared_replace(str, rb_str_casemap(str, &flags, enc)); modify = ONIGENC_CASE_MODIFIED & flags; } -- cgit v1.2.3