ruby-changes:28661
From: usa <ko1@a...>
Date: Tue, 14 May 2013 10:41:35 +0900 (JST)
Subject: [ruby-changes:28661] usa:r40713 (ruby_1_9_3): * regexec.c (onig_search): fix problem with optimization of \z.
usa 2013-05-14 10:41:24 +0900 (Tue, 14 May 2013) New Revision: 40713 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=40713 Log: * regexec.c (onig_search): fix problem with optimization of \z. [Backport #8210] patched by k_tanaka at [ruby-core:54251]. Modified files: branches/ruby_1_9_3/ChangeLog branches/ruby_1_9_3/regexec.c branches/ruby_1_9_3/version.h Index: ruby_1_9_3/ChangeLog =================================================================== --- ruby_1_9_3/ChangeLog (revision 40712) +++ ruby_1_9_3/ChangeLog (revision 40713) @@ -1,3 +1,9 @@ https://github.com/ruby/ruby/blob/trunk/ruby_1_9_3/ChangeLog#L1 +Tue May 14 10:39:33 2013 NAKAMURA Usaku <usa@r...> + + * regexec.c (onig_search): fix problem with optimization of \z. + [Backport #8210] + patched by k_tanaka at [ruby-core:54251]. + Tue May 14 09:36:14 2013 Nobuyoshi Nakada <nobu@r...> * time.c (GetTimeval): check if already initialized instance. Index: ruby_1_9_3/regexec.c =================================================================== --- ruby_1_9_3/regexec.c (revision 40712) +++ ruby_1_9_3/regexec.c (revision 40713) @@ -3515,15 +3515,14 @@ onig_search(regex_t* reg, const UChar* s https://github.com/ruby/ruby/blob/trunk/ruby_1_9_3/regexec.c#L3515 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) { Index: ruby_1_9_3/version.h =================================================================== --- ruby_1_9_3/version.h (revision 40712) +++ ruby_1_9_3/version.h (revision 40713) @@ -1,5 +1,5 @@ https://github.com/ruby/ruby/blob/trunk/ruby_1_9_3/version.h#L1 #define RUBY_VERSION "1.9.3" -#define RUBY_PATCHLEVEL 417 +#define RUBY_PATCHLEVEL 418 #define RUBY_RELEASE_DATE "2013-05-14" #define RUBY_RELEASE_YEAR 2013 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/