summaryrefslogtreecommitdiff
path: root/regex.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>1999-05-18 06:06:17 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>1999-05-18 06:06:17 +0000
commitdf5a9e28234919326128db50c13467d971871cbf (patch)
tree79a6e234266f7a54fc3c657a7752fe74943748db /regex.c
parentc59869494a1a299cad47676e626cfc918c92364e (diff)
mbc bug in regex
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_3@471 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'regex.c')
-rw-r--r--regex.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/regex.c b/regex.c
index 29e7207..3199fe4 100644
--- a/regex.c
+++ b/regex.c
@@ -2968,9 +2968,11 @@ re_search(bufp, string, size, startpos, range, regs)
while (range > 0) {
c = *p++;
if (ismbchar(c)) {
- int len = mbclen(c) - 1;
+ int len;
+
if (fastmap[c])
break;
+ len = mbclen(c) - 1;
while (len--) {
c = *p++;
range--;
@@ -2981,8 +2983,8 @@ re_search(bufp, string, size, startpos, range, regs)
else {
if (fastmap[MAY_TRANSLATE() ? translate[c] : c])
break;
- range--;
}
+ range--;
}
startpos_adjust:
startpos += irange - range;