diff options
| author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2000-06-13 09:42:40 +0000 |
|---|---|---|
| committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2000-06-13 09:42:40 +0000 |
| commit | 87af593ce27b48ca27ee8b5e5278ec2abbad5a5f (patch) | |
| tree | 6bf09f98a1fdc4f538a37d9d12b7ce602c63b0a6 /re.c | |
| parent | 00c5f6b1e53ab40c95e5da02ff8bfb9d5631c00a (diff) | |
| download | ruby-87af593ce27b48ca27ee8b5e5278ec2abbad5a5f.tar.gz ruby-87af593ce27b48ca27ee8b5e5278ec2abbad5a5f.tar.xz ruby-87af593ce27b48ca27ee8b5e5278ec2abbad5a5f.zip | |
2000-06-13
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@750 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 're.c')
| -rw-r--r-- | re.c | 20 |
1 files changed, 12 insertions, 8 deletions
@@ -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) && |
