mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* re.c (rb_reg_search): MatchData must be rb_cMatch. (ruby-bugs-ja:PR#319)
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2781 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
10c4364287
commit
20254d4e13
2 changed files with 9 additions and 6 deletions
|
@ -1,3 +1,8 @@
|
||||||
|
Mon Sep 2 23:01:50 2002 Nobuyoshi Nakada <nobu.nokada@softhome.net>
|
||||||
|
|
||||||
|
* re.c (rb_reg_search): MatchData must be rb_cMatch.
|
||||||
|
(ruby-bugs-ja:PR#319)
|
||||||
|
|
||||||
Mon Sep 2 21:21:46 2002 Minero Aoki <aamine@loveruby.net>
|
Mon Sep 2 21:21:46 2002 Minero Aoki <aamine@loveruby.net>
|
||||||
|
|
||||||
* gc.c (gc_sweep): does reclaim nodes in also compile time, if we
|
* gc.c (gc_sweep): does reclaim nodes in also compile time, if we
|
||||||
|
|
10
re.c
10
re.c
|
@ -237,10 +237,9 @@ rb_reg_expr_str(str, s, len)
|
||||||
p = s;
|
p = s;
|
||||||
while (p<pend) {
|
while (p<pend) {
|
||||||
if (*p == '\\') {
|
if (*p == '\\') {
|
||||||
rb_str_buf_cat(str, p, 1);
|
int n = mbclen(p[1]) + 1;
|
||||||
p++;
|
rb_str_buf_cat(str, p, n);
|
||||||
rb_str_buf_cat(str, p, mbclen(*p));
|
p += n;
|
||||||
p += mbclen(*p);
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
else if (*p == '/') {
|
else if (*p == '/') {
|
||||||
|
@ -251,7 +250,6 @@ rb_reg_expr_str(str, s, len)
|
||||||
else if (ismbchar(*p)) {
|
else if (ismbchar(*p)) {
|
||||||
rb_str_buf_cat(str, p, mbclen(*p));
|
rb_str_buf_cat(str, p, mbclen(*p));
|
||||||
p += mbclen(*p);
|
p += mbclen(*p);
|
||||||
need_escape = 1;
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
else if (ISPRINT(*p)) {
|
else if (ISPRINT(*p)) {
|
||||||
|
@ -725,7 +723,7 @@ rb_reg_search(re, str, pos, reverse)
|
||||||
|
|
||||||
match = rb_backref_get();
|
match = rb_backref_get();
|
||||||
if (NIL_P(match) || FL_TEST(match, MATCH_BUSY)) {
|
if (NIL_P(match) || FL_TEST(match, MATCH_BUSY)) {
|
||||||
match = match_alloc(rb_obj_class(re));
|
match = match_alloc(rb_cMatch);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (rb_safe_level() >= 3)
|
if (rb_safe_level() >= 3)
|
||||||
|
|
Loading…
Reference in a new issue