summaryrefslogtreecommitdiff
path: root/re.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-04-30 08:47:23 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-04-30 08:47:23 +0000
commitcc88283badde1cac04463a990659aa33fb33ca79 (patch)
treeb55603127d70aef41342becc0242a2a338028bd0 /re.c
parent2de3f183190732710ba8859c3259551c628eeda4 (diff)
* 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
Diffstat (limited to 're.c')
-rw-r--r--re.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/re.c b/re.c
index ed8aa8c453..d6a4a55ca8 100644
--- a/re.c
+++ b/re.c
@@ -1255,7 +1255,7 @@ rb_reg_search(VALUE re, VALUE str, int pos, int reverse)
{
int result;
VALUE match;
- static struct re_registers regs;
+ struct re_registers regs;
char *range = RSTRING_PTR(str);
regex_t *reg0 = RREGEXP(re)->ptr, *reg;
int busy = FL_TEST(re, REG_BUSY);
@@ -1271,6 +1271,7 @@ rb_reg_search(VALUE re, VALUE str, int pos, int reverse)
if (!reverse) {
range += RSTRING_LEN(str);
}
+ MEMZERO(&regs, struct re_registers, 1);
result = onig_search(reg,
(UChar*)(RSTRING_PTR(str)),
((UChar*)(RSTRING_PTR(str)) + RSTRING_LEN(str)),