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

ruby-changes:4020

From: ko1@a...
Date: Sat, 16 Feb 2008 20:43:25 +0900 (JST)
Subject: [ruby-changes:4020] akr - Ruby:r15510 (trunk): * encoding.c (rb_enc_compatible): check encoding incapable arguments.

akr	2008-02-16 20:43:12 +0900 (Sat, 16 Feb 2008)

  New Revision: 15510

  Modified files:
    trunk/ChangeLog
    trunk/encoding.c

  Log:
    * encoding.c (rb_enc_compatible): check encoding incapable arguments.


  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/ChangeLog?r1=15510&r2=15509&diff_format=u
  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/encoding.c?r1=15510&r2=15509&diff_format=u

Index: encoding.c
===================================================================
--- encoding.c	(revision 15509)
+++ encoding.c	(revision 15510)
@@ -659,6 +659,9 @@
     idx1 = rb_enc_get_index(str1);
     idx2 = rb_enc_get_index(str2);
 
+    if (idx1 < 0 || idx2 < 0)
+        return 0;
+
     if (idx1 == idx2) {
 	return rb_enc_from_index(idx1);
     }
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 15509)
+++ ChangeLog	(revision 15510)
@@ -1,3 +1,7 @@
+Sat Feb 16 18:13:53 2008  Tanaka Akira  <akr@f...>
+
+	* encoding.c (rb_enc_compatible): check encoding incapable arguments.
+
 Sat Feb 16 20:12:47 2008  Tanaka Akira  <akr@f...>
 
 	* re.c (match_inspect): avoid SEGV with MatchData.allocate.inspect.
@@ -108,7 +112,7 @@
 
 Fri Feb 15 10:35:54 2008  Nobuyoshi Nakada  <nobu@r...>
 
-	* re.c (rb_reg_quote): set US-ACII for ASCII-only string.
+	* re.c (rb_reg_quote): set US-ASCII for ASCII-only string.
 	  [ruby-dev:33785]
 
 Fri Feb 15 10:27:47 2008  Nobuyoshi Nakada  <nobu@r...>
@@ -275,7 +279,7 @@
 	* bootstraptest/runner.rb, bootstraptest/test_method.rb, enc/depend,
 	  instruby.rb, lib/mkmf.rb, lib/test/unit/util/procwrapper.rb,
 	  mkconfig.rb, sample/test.rb, template/vm.inc.tmpl,
-	  test/ruby/test_stringchar.rb: fixes arround String#gsub.
+	  test/ruby/test_stringchar.rb: fixes around String#gsub.
 
 
 Tue Feb 12 15:11:47 2008  NARUSE, Yui  <naruse@r...>
@@ -290,7 +294,7 @@
 	  lib/rexml/quickpath.rb, lib/rexml/text.rb, lib/rss/parser.rb,
 	  lib/uri/common.rb, lib/uri/generic.rb, lib/webrick/httpresponse.rb,
 	  lib/webrick/httpservlet/filehandler.rb, lib/yaml/baseemitter.rb,
-	  lib/yaml/encoding.rb: performance tuning arround String#gsub.
+	  lib/yaml/encoding.rb: performance tuning around String#gsub.
 
 Tue Feb 12 12:16:45 2008  Yukihiro Matsumoto  <matz@r...>
 

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

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