summaryrefslogtreecommitdiff
path: root/re.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>1999-11-04 08:39:57 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>1999-11-04 08:39:57 +0000
commita9e9697994a08600f5dbb46a1fe2a07233cb4890 (patch)
tree9976842c343a888dc34f5cc53ecedc5abb358669 /re.c
parent0d684beafb4258da9606b1e3b4448511b709a2e2 (diff)
19991104
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@557 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 're.c')
-rw-r--r--re.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/re.c b/re.c
index 8bc15c1..04d4978 100644
--- a/re.c
+++ b/re.c
@@ -182,6 +182,21 @@ kcode_reset_option()
}
}
+int
+rb_mbclen2(c, re)
+ unsigned char c;
+ VALUE re;
+{
+ int len;
+
+ if (!FL_TEST(re, KCODE_FIXED))
+ return mbclen(c);
+ kcode_set_option(re);
+ len = mbclen(c);
+ kcode_reset_option();
+ return len;
+}
+
extern int ruby_in_compile;
static void
@@ -538,6 +553,7 @@ rb_reg_search(reg, str, pos, reverse)
}
result = re_search(RREGEXP(reg)->ptr,RSTRING(str)->ptr,RSTRING(str)->len,
pos, range, regs);
+
if (FL_TEST(reg, KCODE_FIXED))
kcode_reset_option();