From 9ee0cafbfe7a94a7b6a9d0e7f2dbf7c7fd229757 Mon Sep 17 00:00:00 2001 From: matz Date: Tue, 13 Jun 2000 09:42:40 +0000 Subject: 2000-06-13 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@750 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- re.c | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) (limited to 're.c') diff --git a/re.c b/re.c index ca1972add6..5559ce0a0f 100644 --- a/re.c +++ b/re.c @@ -520,16 +520,20 @@ rb_reg_prepare_re(re) VALUE re; { int need_recompile = 0; + int state; rb_reg_check(re); - /* case-flag not set for the object */ - if (!(RREGEXP(re)->ptr->options & RE_OPTION_IGNORECASE)) { - int state = FL_TEST(re, REG_CASESTATE); - - if ((ruby_ignorecase || state) && !(ruby_ignorecase && state)) { - RBASIC(re)->flags ^= REG_CASESTATE; - need_recompile = 1; - } + state = FL_TEST(re, REG_CASESTATE); + /* ignorecase status */ + if (ruby_ignorecase && !state) { + FL_SET(re, REG_CASESTATE); + RREGEXP(re)->ptr->options |= RE_OPTION_IGNORECASE; + need_recompile = 1; + } + if (!ruby_ignorecase && state) { + FL_UNSET(re, REG_CASESTATE); + RREGEXP(re)->ptr->options &= ~RE_OPTION_IGNORECASE; + need_recompile = 1; } if (!FL_TEST(re, KCODE_FIXED) && -- cgit v1.2.3