summaryrefslogtreecommitdiff
path: root/re.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>1999-02-24 04:31:29 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>1999-02-24 04:31:29 +0000
commit3976feed73bf4ec27183824870ee077c2b5b00b1 (patch)
treecb461ab9246a2c8e13d373a8c2d2e6378e4db9cc /re.c
parent51fa86ece2d2b0f72c86c70fe1314e412c7a9e68 (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.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/re.c b/re.c
index 7cf085adc9..786e28f2fb 100644
--- a/re.c
+++ b/re.c
@@ -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;