From 8c43fc0217cc0a2876a4f86d282739c92f80270a Mon Sep 17 00:00:00 2001 From: nagachika Date: Fri, 19 Apr 2013 16:40:32 +0000 Subject: merge revision(s) 40276: [Backport #8210] * Merge Onigmo 5.13.4 f22cf2e566712cace60d17f84d63119d7c5764ee. [bug] fix problem with optimization of \z (Issue #16) [Bug #8210] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_0_0@40384 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- regexec.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'regexec.c') diff --git a/regexec.c b/regexec.c index 3b75545bf0..997849695e 100644 --- a/regexec.c +++ b/regexec.c @@ -4020,15 +4020,14 @@ onig_search_gpos(regex_t* reg, const UChar* str, const UChar* end, start = min_semi_end - reg->anchor_dmax; if (start < end) start = onigenc_get_right_adjust_char_head(reg->enc, str, start, end); - else { /* match with empty at end */ - start = onigenc_get_prev_char_head(reg->enc, str, end, end); - } } if ((OnigDistance )(max_semi_end - (range - 1)) < reg->anchor_dmin) { range = max_semi_end - reg->anchor_dmin + 1; } - if (start >= range) goto mismatch_no_msa; + if (start > range) goto mismatch_no_msa; + /* If start == range, match with empty at end. + Backward search is used. */ } else { if ((OnigDistance )(min_semi_end - range) > reg->anchor_dmax) { @@ -4258,7 +4257,7 @@ onig_search_gpos(regex_t* reg, const UChar* str, const UChar* end, ONIG_STATE_DEC_THREAD(reg); /* If result is mismatch and no FIND_NOT_EMPTY option, - then the region is not setted in match_at(). */ + then the region is not set in match_at(). */ if (IS_FIND_NOT_EMPTY(reg->options) && region #ifdef USE_POSIX_API_REGION_OPTION && !IS_POSIX_REGION(option) -- cgit v1.2.3