diff options
| author | aamine <aamine@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-01-10 09:59:11 +0000 |
|---|---|---|
| committer | aamine <aamine@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-01-10 09:59:11 +0000 |
| commit | d1b1e82680f483629a37b710fd9b0c4104d28699 (patch) | |
| tree | bfbcc33481054ad2ec1533e2ac3a5cf7129038be /ext | |
| parent | adbef8818ff3f4a0d27c411cc06372f69a000f6f (diff) | |
| download | ruby-d1b1e82680f483629a37b710fd9b0c4104d28699.tar.gz ruby-d1b1e82680f483629a37b710fd9b0c4104d28699.tar.xz ruby-d1b1e82680f483629a37b710fd9b0c4104d28699.zip | |
* 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: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8@11524 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext')
| -rw-r--r-- | ext/strscan/strscan.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/ext/strscan/strscan.c b/ext/strscan/strscan.c index fdbfc7991..b5ee20282 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) { |
