diff options
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | enc/unicode.c | 2 | ||||
-rw-r--r-- | string.c | 2 |
3 files changed, 8 insertions, 2 deletions
@@ -1,3 +1,9 @@ +Mon Feb 8 20:43:57 2016 Martin Duerst <[email protected]> + + * string.c, enc/unicode.c: Disassociating ONIGENC_CASE_FOLD flag from + ONIGENC_CASE_DOWNCASE. + (with Kimihito Matsui) + Mon Feb 8 13:00:17 2016 Martin Duerst <[email protected]> * enc/unicode.c: Shortened macros for enc/unicode/casefold.h to diff --git a/enc/unicode.c b/enc/unicode.c index 8b2d4386f8..96294f7c3c 100644 --- a/enc/unicode.c +++ b/enc/unicode.c @@ -651,7 +651,7 @@ onigenc_unicode_case_map(OnigCaseFoldType* flagP, } } else if (code>='A' && code<='Z') { - if (flags&ONIGENC_CASE_DOWNCASE) { + if (flags&(ONIGENC_CASE_DOWNCASE|ONIGENC_CASE_FOLD)) { MODIFIED; if (flags&ONIGENC_CASE_FOLD_TURKISH_AZERI && code=='I') code = DOTLESS_i; @@ -5647,7 +5647,7 @@ check_case_options(int argc, VALUE *argv, OnigCaseFoldType flags) flags |= ONIGENC_CASE_ASCII_ONLY; else if (argv[0]==sym_fold) { if ((flags & (ONIGENC_CASE_UPCASE|ONIGENC_CASE_DOWNCASE)) == ONIGENC_CASE_DOWNCASE) - flags |= ONIGENC_CASE_FOLD; + flags ^= ONIGENC_CASE_FOLD|ONIGENC_CASE_DOWNCASE; else rb_raise(rb_eArgError, "option :fold only allowed for downcasing"); } |