From d5a00279f44dcb9dcd37c767bcd2c51a5101431d Mon Sep 17 00:00:00 2001 From: kosako Date: Sat, 23 Sep 2006 12:01:58 +0000 Subject: merge Oniguruma 4.4.4 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10998 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- regexec.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'regexec.c') diff --git a/regexec.c b/regexec.c index 1ba060f0ec..1a9567a3d0 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; -- cgit v1.2.3