[前][次][番号順一覧][スレッド一覧]

ruby-changes:27666

From: naruse <ko1@a...>
Date: Mon, 11 Mar 2013 12:47:12 +0900 (JST)
Subject: [ruby-changes:27666] naruse:r39718 (trunk): * Merge Onigmo d4bad41e16e3eccd97ccce6f1f96712e557c4518.

naruse	2013-03-11 12:46:55 +0900 (Mon, 11 Mar 2013)

  New Revision: 39718

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=39718

  Log:
    * Merge Onigmo d4bad41e16e3eccd97ccce6f1f96712e557c4518.
      fix lookbehind assertion fails with /m mode enabled. [Bug #8023]
      fix \Z matches where it shouldn't. [Bug #8001]

  Modified files:
    trunk/ChangeLog
    trunk/regexec.c
    trunk/tool/enc-unicode.rb

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 39717)
+++ ChangeLog	(revision 39718)
@@ -1,3 +1,9 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Mon Mar 11 12:25:12 2013  NARUSE, Yui  <naruse@r...>
+
+	* 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@r...>
 
 	* lib/mkmf.rb (MakeMakefile#dir_config, MakeMakefile#_libdir_basename):
Index: regexec.c
===================================================================
--- regexec.c	(revision 39717)
+++ regexec.c	(revision 39718)
@@ -3,7 +3,7 @@ https://github.com/ruby/ruby/blob/trunk/regexec.c#L3
 **********************************************************************/
 /*-
  * 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, https://github.com/ruby/ruby/blob/trunk/regexec.c#L2219
 	  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 UCh https://github.com/ruby/ruby/blob/trunk/regexec.c#L4066
       }
     }
     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 */
Index: tool/enc-unicode.rb
===================================================================
--- tool/enc-unicode.rb	(revision 39717)
+++ tool/enc-unicode.rb	(revision 39718)
@@ -187,7 +187,7 @@ def parse_age(data) https://github.com/ruby/ruby/blob/trunk/tool/enc-unicode.rb#L187
   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}")

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]