aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-03-11 03:46:55 +0000
committernaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-03-11 03:46:55 +0000
commit407bcb4bc6207a2668c2c801711a5eb0bcbfc100 (patch)
treea76a63bfcf4c5f9a614cfe4a40df38f7b8083b4f
parent76d8cc33f9ef4f8d17bb8516a26e1d41e10cbc0f (diff)
downloadruby-407bcb4bc6207a2668c2c801711a5eb0bcbfc100.tar.gz
* Merge Onigmo d4bad41e16e3eccd97ccce6f1f96712e557c4518.
fix lookbehind assertion fails with /m mode enabled. [Bug #8023] fix \Z matches where it shouldn't. [Bug #8001] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39718 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog6
-rw-r--r--regexec.c9
-rwxr-xr-xtool/enc-unicode.rb2
3 files changed, 13 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index 46d4a9eea9..479fa5bd4f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+Mon Mar 11 12:25:12 2013 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * Merge Onigmo d4bad41e16e3eccd97ccce6f1f96712e557c4518.
+ fix lookbehind assertion fails with /m mode enabled. [Bug #8023]
+ fix \Z matches where it shouldn't. [Bug #8001]
+
Mon Mar 11 11:53:35 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
* lib/mkmf.rb (MakeMakefile#dir_config, MakeMakefile#_libdir_basename):
diff --git a/regexec.c b/regexec.c
index 553186135b..3b75545bf0 100644
--- a/regexec.c
+++ b/regexec.c
@@ -3,7 +3,7 @@
**********************************************************************/
/*-
* Copyright (c) 2002-2008 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>
- * Copyright (c) 2011-2012 K.Takata <kentkt AT csc DOT jp>
+ * Copyright (c) 2011-2013 K.Takata <kentkt AT csc DOT jp>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -2219,7 +2219,8 @@ match_at(regex_t* reg, const UChar* str, const UChar* end,
continue;
}
#ifdef USE_CRNL_AS_LINE_TERMINATOR
- else if (ss < end) {
+ else if (IS_NEWLINE_CRLF(option)
+ && ONIGENC_IS_MBC_CRNL(encode, s, end)) {
ss += enclen(encode, ss, end);
if (ON_STR_END(ss)) {
MOP_OUT;
@@ -4065,7 +4066,9 @@ onig_search_gpos(regex_t* reg, const UChar* str, const UChar* end,
}
}
else if ((reg->anchor & ANCHOR_ANYCHAR_STAR_ML)) {
- goto begin_position;
+ if (! (reg->anchor & ANCHOR_LOOK_BEHIND)) {
+ goto begin_position;
+ }
}
}
else if (str == end) { /* empty string */
diff --git a/tool/enc-unicode.rb b/tool/enc-unicode.rb
index 255d9c5175..b2f9d3da6c 100755
--- a/tool/enc-unicode.rb
+++ b/tool/enc-unicode.rb
@@ -187,7 +187,7 @@ def parse_age(data)
IO.foreach(get_file('DerivedAge.txt')) do |line|
if /^# Total code points: / =~ line
constname = constantize_agename(current)
- # each version matches all previous versions
+ # each version matches all previous versions
cps.concat(data[last_constname]) if last_constname
data[constname] = cps
make_const(constname, cps, "Derived Age #{current}")