diff options
author | kosako <kosako@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2006-09-23 12:01:58 +0000 |
---|---|---|
committer | kosako <kosako@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2006-09-23 12:01:58 +0000 |
commit | d5a00279f44dcb9dcd37c767bcd2c51a5101431d (patch) | |
tree | b1e293d0baac3b58f50d661354250fdd4f56ebbf /regexec.c | |
parent | b6ec2b7c6de88f457d480e9a6892b84c133bd92c (diff) | |
download | ruby-d5a00279f44dcb9dcd37c767bcd2c51a5101431d.tar.gz |
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.c | 14 |
1 files changed, 7 insertions, 7 deletions
@@ -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; |