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

ruby-changes:18395

From: usa <ko1@a...>
Date: Wed, 29 Dec 2010 18:24:44 +0900 (JST)
Subject: [ruby-changes:18395] Ruby:r30418 (trunk): Sorry, commit miss of r30412.

usa	2010-12-29 18:24:37 +0900 (Wed, 29 Dec 2010)

  New Revision: 30418

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

  Log:
    Sorry, commit miss of r30412.
    
    * re.c (rb_reg_expr_str): need to escape if the coderage is invalid.

  Modified files:
    trunk/ChangeLog
    trunk/re.c

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 30417)
+++ ChangeLog	(revision 30418)
@@ -1,3 +1,7 @@
+Wed Dec 29 18:23:46 2010  NAKAMURA Usaku  <usa@r...>
+
+	* re.c (rb_reg_expr_str): need to escape if the coderage is invalid.
+
 Wed Dec 29 10:06:51 2010  Tanaka Akira  <akr@f...>
 
 	* signal.c: parenthesize macro arguments.
@@ -12,8 +16,6 @@
 
 Tue Dec 28 18:36:38 2010  NAKAMURA Usaku  <usa@r...>
 
-	* re.c (rb_reg_expr_str): need to escape if the coderage is invalid.
-
 	* error.c, include/ruby/intern.h (rb_compile_error_with_enc): new
 	  function to raise syntax error, with source encoding'ed message.
 
Index: re.c
===================================================================
--- re.c	(revision 30417)
+++ re.c	(revision 30418)
@@ -321,11 +321,14 @@
 	rb_encoding *enc, rb_encoding *resenc)
 {
     const char *p, *pend;
+    int cr = ENC_CODERANGE_UNKNOWN;
     int need_escape = 0;
     int c, clen;
 
     p = s; pend = p + len;
-    if (rb_enc_asciicompat(enc)) {
+    rb_str_coderange_scan_restartable(p, pend, enc, &cr);
+    if (rb_enc_asciicompat(enc) &&
+	(cr == ENC_CODERANGE_VALID || cr == ENC_CODERANGE_7BIT)) {
 	while (p < pend) {
 	    c = rb_enc_ascget(p, pend, &clen, enc);
 	    if (c == -1) {

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

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