summaryrefslogtreecommitdiff
path: root/regexec.c
diff options
context:
space:
mode:
authorkosako <kosako@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2006-09-23 12:01:58 (GMT)
committerkosako <kosako@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2006-09-23 12:01:58 (GMT)
commitd5a00279f44dcb9dcd37c767bcd2c51a5101431d (patch)
treeb1e293d0baac3b58f50d661354250fdd4f56ebbf /regexec.c
parentb6ec2b7c6de88f457d480e9a6892b84c133bd92c (diff)
merge Oniguruma 4.4.4
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10998 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'regexec.c')
-rw-r--r--regexec.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/regexec.c b/regexec.c
index 1ba060f..1a9567a 100644
--- a/regexec.c
+++ b/regexec.c
@@ -3066,19 +3066,19 @@ bm_search_notrev(regex_t* reg, const UChar* target, const UChar* target_end,
(int )text, (int )text_end, (int )text_range);
#endif
- tlen1 = (target_end - target) - 1;
- end = text_range + tlen1;
- if (end > text_end)
- end = text_end;
-
tail = target_end - 1;
+ tlen1 = tail - target;
+ end = text_range;
+ if (end + tlen1 > text_end)
+ end = text_end - tlen1;
+
s = text;
if (IS_NULL(reg->int_map)) {
while (s < end) {
p = se = s + tlen1;
t = tail;
- while (*p == *t && t >= target) {
+ while (t >= target && *p == *t) {
p--; t--;
}
if (t < target) return (UChar* )s;
@@ -3094,7 +3094,7 @@ bm_search_notrev(regex_t* reg, const UChar* target, const UChar* target_end,
while (s < end) {
p = se = s + tlen1;
t = tail;
- while (*p == *t && t >= target) {
+ while (t >= target && *p == *t) {
p--; t--;
}
if (t < target) return (UChar* )s;