summaryrefslogtreecommitdiff
path: root/ext/strscan
diff options
context:
space:
mode:
authorkosako <kosako@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-02-28 13:04:28 +0000
committerkosako <kosako@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-02-28 13:04:28 +0000
commitf4900ea772c7dff3c6cf3b0f9c38315681e7d4fe (patch)
treef3a6dd174212556c6a13b6f1fd1accc1c7f3ed4f /ext/strscan
parent4200ee6e69b41ecc508f9cf68db506ec74058d50 (diff)
strscan.c: use new Oniguruma API.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@8038 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/strscan')
-rw-r--r--ext/strscan/strscan.c13
1 files changed, 3 insertions, 10 deletions
diff --git a/ext/strscan/strscan.c b/ext/strscan/strscan.c
index ab1428b..e6df60e 100644
--- a/ext/strscan/strscan.c
+++ b/ext/strscan/strscan.c
@@ -185,7 +185,7 @@ strscan_s_allocate(klass)
p = ALLOC(struct strscanner);
MEMZERO(p, struct strscanner, 1);
CLEAR_MATCH_STATUS(p);
- MEMZERO(&(p->regs), struct re_registers, 1);
+ onig_region_init(&(p->regs));
p->str = Qnil;
return Data_Wrap_Struct(klass, strscan_mark, strscan_free, p);
}
@@ -678,19 +678,12 @@ strscan_search_full(self, re, s, f)
return strscan_do_scan(self, re, RTEST(s), RTEST(f), 0);
}
-/* DANGEROUS; need to synchronize with regex.c */
static void
adjust_registers_to_matched(p)
struct strscanner *p;
{
- if (p->regs.allocated == 0) {
- p->regs.beg = ALLOC_N(int, ONIG_NREGION);
- p->regs.end = ALLOC_N(int, ONIG_NREGION);
- p->regs.allocated = ONIG_NREGION;
- }
- p->regs.num_regs = 1;
- p->regs.beg[0] = 0;
- p->regs.end[0] = p->curr - p->prev;
+ onig_region_clear(&(p->regs));
+ onig_region_set(&(p->regs), 0, 0, p->curr - p->prev);
}
/*