summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authoraamine <aamine@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-01-10 09:59:11 +0000
committeraamine <aamine@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-01-10 09:59:11 +0000
commit2785c7c05ff7c4c0af591b38530fdddac96a52d0 (patch)
treebfbcc33481054ad2ec1533e2ac3a5cf7129038be /ext
parentd158c316839252f07519ffc9448614fc4b7a3588 (diff)
* ext/strscan/strscan.c (strscan_do_scan): should set kcode option before match. [ruby-dev:29914]
* test/strscan/test_stringscanner.rb: test it. * re.c: export kcode_set_option and kcode_reset_option (with "rb_" prefix). * intern.h: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@11524 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext')
-rw-r--r--ext/strscan/strscan.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/ext/strscan/strscan.c b/ext/strscan/strscan.c
index fdbfc79919..b5ee20282c 100644
--- a/ext/strscan/strscan.c
+++ b/ext/strscan/strscan.c
@@ -403,6 +403,7 @@ strscan_do_scan(VALUE self, VALUE regex, int succptr, int getstr, int headonly)
if (S_RESTLEN(p) < 0) {
return Qnil;
}
+ rb_kcode_set_option(regex);
if (headonly) {
ret = re_match(RREGEXP(regex)->ptr,
CURPTR(p), S_RESTLEN(p),
@@ -416,6 +417,7 @@ strscan_do_scan(VALUE self, VALUE regex, int succptr, int getstr, int headonly)
S_RESTLEN(p),
&(p->regs));
}
+ rb_kcode_reset_option();
if (ret == -2) rb_raise(ScanError, "regexp buffer overflow");
if (ret < 0) {