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

ruby-changes:12091

From: yugui <ko1@a...>
Date: Sat, 20 Jun 2009 18:08:18 +0900 (JST)
Subject: [ruby-changes:12091] Ruby:r23761 (ruby_1_9_1): merges r23562 and r23564 from trunk into ruby_1_9_1.

yugui	2009-06-20 18:07:02 +0900 (Sat, 20 Jun 2009)

  New Revision: 23761

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

  Log:
    merges r23562 and r23564 from trunk into ruby_1_9_1.
    --
    * string.c (rb_str_partition): should use the converted result.  a
      patch from Marc-Andre Lafortune at [ruby-core:23540].
    --
    * string.c (rb_str_rpartition): ditto.

  Modified files:
    branches/ruby_1_9_1/ChangeLog
    branches/ruby_1_9_1/string.c
    branches/ruby_1_9_1/test/ruby/test_string.rb
    branches/ruby_1_9_1/version.h

Index: ruby_1_9_1/ChangeLog
===================================================================
--- ruby_1_9_1/ChangeLog	(revision 23760)
+++ ruby_1_9_1/ChangeLog	(revision 23761)
@@ -1,3 +1,10 @@
+Mon May 25 08:06:52 2009  Nobuyoshi Nakada  <nobu@r...>
+
+	* string.c (rb_str_partition): should use the converted result.  a
+	  patch from Marc-Andre Lafortune at [ruby-core:23540].
+
+	* string.c (rb_str_rpartition): ditto.
+
 Mon May 25 05:32:19 2009  Yukihiro Matsumoto  <matz@r...>
 
 	* lib/cgi/core.rb (CGI::HTTP_STATUS): typo fixed.  a patch from
Index: ruby_1_9_1/string.c
===================================================================
--- ruby_1_9_1/string.c	(revision 23760)
+++ ruby_1_9_1/string.c	(revision 23761)
@@ -6645,6 +6645,7 @@
 	    rb_raise(rb_eTypeError, "type mismatch: %s given",
 		     rb_obj_classname(sep));
 	}
+	sep = tmp;
 	pos = rb_str_index(str, sep, 0);
     }
     if (pos < 0) {
@@ -6692,6 +6693,7 @@
 	    rb_raise(rb_eTypeError, "type mismatch: %s given",
 		     rb_obj_classname(sep));
 	}
+	sep = tmp;
 	pos = rb_str_sublen(str, pos);
 	pos = rb_str_rindex(str, sep, pos);
     }
Index: ruby_1_9_1/version.h
===================================================================
--- ruby_1_9_1/version.h	(revision 23760)
+++ ruby_1_9_1/version.h	(revision 23761)
@@ -1,6 +1,6 @@
 #define RUBY_VERSION "1.9.1"
 #define RUBY_RELEASE_DATE "2009-05-22"
-#define RUBY_PATCHLEVEL 159
+#define RUBY_PATCHLEVEL 160
 #define RUBY_VERSION_MAJOR 1
 #define RUBY_VERSION_MINOR 9
 #define RUBY_VERSION_TEENY 1
Index: ruby_1_9_1/test/ruby/test_string.rb
===================================================================
--- ruby_1_9_1/test/ruby/test_string.rb	(revision 23760)
+++ ruby_1_9_1/test/ruby/test_string.rb	(revision 23761)
@@ -1699,12 +1699,16 @@
     assert_equal(%w(he l lo), "hello".partition(/l/))
     assert_equal(%w(he l lo), "hello".partition("l"))
     assert_raise(TypeError) { "hello".partition(1) }
+    def (hyphen = Object.new).to_str; "-"; end
+    assert_equal(%w(foo - bar), "foo-bar".partition(hyphen), '[ruby-core:23540]')
   end
 
   def test_rpartition
     assert_equal(%w(hel l o), "hello".rpartition(/l/))
     assert_equal(%w(hel l o), "hello".rpartition("l"))
     assert_raise(TypeError) { "hello".rpartition(1) }
+    def (hyphen = Object.new).to_str; "-"; end
+    assert_equal(%w(foo - bar), "foo-bar".rpartition(hyphen), '[ruby-core:23540]')
   end
 
   def test_setter

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

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