summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-05-14 01:41:24 +0000
committerusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-05-14 01:41:24 +0000
commite8905e1042009a1f8b3f43d8890b2cb7a9217053 (patch)
tree50d68e8293a6987f9f9090f7b330c9ab06ab15bc
parent95d36502f52f1c5d586841b93b18f33b8a28669f (diff)
* regexec.c (onig_search): fix problem with optimization of \z.
[Backport #8210] patched by k_tanaka at [ruby-core:54251]. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@40713 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog6
-rw-r--r--regexec.c7
-rw-r--r--version.h2
3 files changed, 10 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog
index 0b059f769b..73a730b9d9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+Tue May 14 10:39:33 2013 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * 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@ruby-lang.org>
* time.c (GetTimeval): check if already initialized instance.
diff --git a/regexec.c b/regexec.c
index 55c28178c4..33b4a4efa6 100644
--- a/regexec.c
+++ b/regexec.c
@@ -3515,15 +3515,14 @@ onig_search(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) {
diff --git a/version.h b/version.h
index 211a273603..a1f6aebff0 100644
--- a/version.h
+++ b/version.h
@@ -1,5 +1,5 @@
#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