diff options
author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 1999-02-24 04:31:29 +0000 |
---|---|---|
committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 1999-02-24 04:31:29 +0000 |
commit | 3976feed73bf4ec27183824870ee077c2b5b00b1 (patch) | |
tree | cb461ab9246a2c8e13d373a8c2d2e6378e4db9cc /re.c | |
parent | 51fa86ece2d2b0f72c86c70fe1314e412c7a9e68 (diff) |
990224
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_3@405 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 're.c')
-rw-r--r-- | re.c | 9 |
1 files changed, 6 insertions, 3 deletions
@@ -879,8 +879,11 @@ rb_reg_s_quote(re, str) for (; s != send; s++) { if (ismbchar(*s)) { - *t++ = *s++; - *t++ = *s; + size_t n = mbclen(*s); + + while (n--) + *t++ = *s++; + s--; continue; } if (*s == '[' || *s == ']' @@ -979,7 +982,7 @@ rb_reg_regsub(str, src, regs) c = *s++; if (ismbchar(c)) { - s++; + s += mbclen(c) - 1; continue; } if (c != '\\' || s == e) continue; |