* re.c (rb_reg_search): use local variable. a patch from wanabe
<s.wanabe AT gmail.com> in [ruby-dev:34537]. [ruby-dev:34492] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16239 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
2de3f18319
commit
cc88283bad
@ -1,3 +1,8 @@
|
|||||||
|
Wed Apr 30 17:47:21 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
|
* re.c (rb_reg_search): use local variable. a patch from wanabe
|
||||||
|
<s.wanabe AT gmail.com> in [ruby-dev:34537]. [ruby-dev:34492]
|
||||||
|
|
||||||
Wed Apr 30 16:10:18 2008 Yusuke Endoh <mame@tsg.ne.jp>
|
Wed Apr 30 16:10:18 2008 Yusuke Endoh <mame@tsg.ne.jp>
|
||||||
|
|
||||||
* eval_intern.h: speficy the values of the enumeration constants
|
* eval_intern.h: speficy the values of the enumeration constants
|
||||||
|
3
re.c
3
re.c
@ -1255,7 +1255,7 @@ rb_reg_search(VALUE re, VALUE str, int pos, int reverse)
|
|||||||
{
|
{
|
||||||
int result;
|
int result;
|
||||||
VALUE match;
|
VALUE match;
|
||||||
static struct re_registers regs;
|
struct re_registers regs;
|
||||||
char *range = RSTRING_PTR(str);
|
char *range = RSTRING_PTR(str);
|
||||||
regex_t *reg0 = RREGEXP(re)->ptr, *reg;
|
regex_t *reg0 = RREGEXP(re)->ptr, *reg;
|
||||||
int busy = FL_TEST(re, REG_BUSY);
|
int busy = FL_TEST(re, REG_BUSY);
|
||||||
@ -1271,6 +1271,7 @@ rb_reg_search(VALUE re, VALUE str, int pos, int reverse)
|
|||||||
if (!reverse) {
|
if (!reverse) {
|
||||||
range += RSTRING_LEN(str);
|
range += RSTRING_LEN(str);
|
||||||
}
|
}
|
||||||
|
MEMZERO(®s, struct re_registers, 1);
|
||||||
result = onig_search(reg,
|
result = onig_search(reg,
|
||||||
(UChar*)(RSTRING_PTR(str)),
|
(UChar*)(RSTRING_PTR(str)),
|
||||||
((UChar*)(RSTRING_PTR(str)) + RSTRING_LEN(str)),
|
((UChar*)(RSTRING_PTR(str)) + RSTRING_LEN(str)),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user