From 5d7a215f6e4fddb5dedcd9bb20d3dd1c8d9f3195 Mon Sep 17 00:00:00 2001 From: matz Date: Tue, 30 Jun 2009 09:06:48 +0000 Subject: * re.c (reg_match_pos): adjust offset based on characters, not bytes. [ruby-dev:38722] * string.c (rb_str_offset): new function. * string.c (rb_str_index_m): no call to rb_reg_adjust_startpos(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23916 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- re.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 're.c') diff --git a/re.c b/re.c index 528e94a829..447728da09 100644 --- a/re.c +++ b/re.c @@ -2564,7 +2564,7 @@ reg_match_pos(VALUE re, VALUE *strp, long pos) return pos; } } - pos = rb_reg_adjust_startpos(re, str, pos, 0); + pos = rb_str_offset(str, pos); } return rb_reg_search(re, str, pos, 0); } -- cgit v1.2.3