aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorduerst <duerst@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-02-08 11:44:12 +0000
committerduerst <duerst@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-02-08 11:44:12 +0000
commit2ca7569c6d2a833977b2bc55329a7c49d87e21df (patch)
tree7e09e779c611ba4666f6922b3c5784d6fb09c024
parentd47534799034576131644967d65e5f380fe1de85 (diff)
downloadruby-2ca7569c6d2a833977b2bc55329a7c49d87e21df.tar.gz
* string.c, enc/unicode.c: Disassociating ONIGENC_CASE_FOLD flag from
ONIGENC_CASE_DOWNCASE. (with Kimihito Matsui) git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53778 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog6
-rw-r--r--enc/unicode.c2
-rw-r--r--string.c2
3 files changed, 8 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index b2ce86dfd3..8969f166d1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+Mon Feb 8 20:43:57 2016 Martin Duerst <duerst@it.aoyama.ac.jp>
+
+ * 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 <duerst@it.aoyama.ac.jp>
* 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;
diff --git a/string.c b/string.c
index 3070cbff03..51751f89b7 100644
--- a/string.c
+++ b/string.c
@@ -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");
}