diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2002-09-02 14:04:19 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2002-09-02 14:04:19 +0000 |
commit | 81ba2325bd19cd99c79937cc53a6c19770f62b84 (patch) | |
tree | d6c7ebd1cdcec0584f110441545d80855d3b7f18 /re.c | |
parent | e5e77efb2d9832fe3d9fc1df33037307f2ea897f (diff) | |
download | ruby-81ba2325bd19cd99c79937cc53a6c19770f62b84.tar.gz ruby-81ba2325bd19cd99c79937cc53a6c19770f62b84.tar.xz ruby-81ba2325bd19cd99c79937cc53a6c19770f62b84.zip |
* re.c (rb_reg_search): MatchData must be rb_cMatch. (ruby-bugs-ja:PR#319)
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@2781 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 're.c')
-rw-r--r-- | re.c | 10 |
1 files changed, 4 insertions, 6 deletions
@@ -237,10 +237,9 @@ rb_reg_expr_str(str, s, len) p = s; while (p<pend) { if (*p == '\\') { - rb_str_buf_cat(str, p, 1); - p++; - rb_str_buf_cat(str, p, mbclen(*p)); - p += mbclen(*p); + int n = mbclen(p[1]) + 1; + rb_str_buf_cat(str, p, n); + p += n; continue; } else if (*p == '/') { @@ -251,7 +250,6 @@ rb_reg_expr_str(str, s, len) else if (ismbchar(*p)) { rb_str_buf_cat(str, p, mbclen(*p)); p += mbclen(*p); - need_escape = 1; continue; } else if (ISPRINT(*p)) { @@ -725,7 +723,7 @@ rb_reg_search(re, str, pos, reverse) match = rb_backref_get(); if (NIL_P(match) || FL_TEST(match, MATCH_BUSY)) { - match = match_alloc(rb_obj_class(re)); + match = match_alloc(rb_cMatch); } else { if (rb_safe_level() >= 3) |