summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog14
-rw-r--r--ext/strscan/strscan.c13
2 files changed, 14 insertions, 13 deletions
diff --git a/ChangeLog b/ChangeLog
index e76019c..9e1ba67 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+Mon Feb 28 21:55:49 2005 K.Kosako <sndgk393 AT ybb.ne.jp>
+
+ * ext/strscan/strscan.c (strscan_s_allocate):
+ use onig_region_init().
+
+ * ext/strscan/strscan.c (adjust_registers_to_matched):
+ use onig_region_set().
+
Mon Feb 28 15:12:06 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
* ext/socket/socket.c (Init_socket): ported more Socket::Constants
@@ -12,7 +20,7 @@ Sun Feb 27 05:55:38 2005 Minero Aoki <aamine@loveruby.net>
* parse.y [ripper]: fix typo. [ruby-core:04494]
-Sat Feb 26 16:58:20 2005 K.Kosako <sndgk393@ybb.ne.jp>
+Sat Feb 26 16:58:20 2005 K.Kosako <sndgk393 AT ybb.ne.jp>
* parse.y, re.c, regex.h, LEGAL, ext/strscan/strscan.c:
remove oniggnu.h (GNU regex API).
@@ -121,11 +129,11 @@ Sat Feb 19 01:28:56 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
* ext/bigdecimal/lib/bigdecimal/nlsolve.rb: removed because this file
is sample script and same file exists in ext/bigdecimal/sample.
-Thu Feb 17 22:15:34 2005 K.Kosako <sndgk@ybb.ne.jp>
+Thu Feb 17 22:15:34 2005 K.Kosako <sndgk393 AT ybb.ne.jp>
* ext/strscan/strscan.c: calls Oniguruma API directly.
-Thu Feb 17 21:53:12 2005 K.Kosako <sndgk@ybb.ne.jp>
+Thu Feb 17 21:53:12 2005 K.Kosako <sndgk393 AT ybb.ne.jp>
* common.mk, LEGAL: remove reggnu.c.
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);
}
/*