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

ruby-changes:9089

From: matz <ko1@a...>
Date: Thu, 11 Dec 2008 13:40:29 +0900 (JST)
Subject: [ruby-changes:9089] Ruby:r20626 (trunk): * re.c (reg_enc_error): raise EncodingCompatibilityError for

matz	2008-12-11 13:40:08 +0900 (Thu, 11 Dec 2008)

  New Revision: 20626

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

  Log:
    * re.c (reg_enc_error): raise EncodingCompatibilityError for
      encoding incompatibility.  [ruby-core:18600]
    * re.c (rb_reg_prepare_enc): more consistent error message.
      [ruby-core:18611]

  Modified files:
    trunk/ChangeLog
    trunk/re.c

Index: re.c
===================================================================
--- re.c	(revision 20625)
+++ re.c	(revision 20626)
@@ -1168,7 +1168,7 @@
 static void
 reg_enc_error(VALUE re, VALUE str)
 {
-    rb_raise(rb_eArgError,
+    rb_raise(rb_eEncCompatError,
 	     "incompatible encoding regexp match (%s regexp with %s string)",
 	     rb_enc_name(RREGEXP(re)->ptr->enc),
 	     rb_enc_name(rb_enc_get(str)));
@@ -1181,7 +1181,7 @@
 
     if (rb_enc_str_coderange(str) == ENC_CODERANGE_BROKEN) {
         rb_raise(rb_eArgError,
-            "broken %s string",
+            "invalid byte sequence in %s",
             rb_enc_name(rb_enc_get(str)));
     }
 
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 20625)
+++ ChangeLog	(revision 20626)
@@ -1,3 +1,11 @@
+Thu Dec 11 13:09:01 2008  Yukihiro Matsumoto  <matz@r...>
+
+	* re.c (reg_enc_error): raise EncodingCompatibilityError for
+	  encoding incompatibility.  [ruby-core:18600]
+
+	* re.c (rb_reg_prepare_enc): more consistent error message.
+	  [ruby-core:18611]
+
 Thu Dec 11 13:36:18 2008  Nobuyoshi Nakada  <nobu@r...>
 
 	* encoding.c (enc_set_default_encoding): allowed to set default

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

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