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

ruby-changes:15137

From: tadf <ko1@a...>
Date: Mon, 22 Mar 2010 19:33:24 +0900 (JST)
Subject: [ruby-changes:15137] Ruby:r27014 (ruby_1_8): * lib/date.rb (Date#>>): fixed.

tadf	2010-03-22 19:33:08 +0900 (Mon, 22 Mar 2010)

  New Revision: 27014

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

  Log:
    * lib/date.rb (Date#>>): fixed.  [ruby-core:28011]

  Modified files:
    branches/ruby_1_8/ChangeLog
    branches/ruby_1_8/lib/date.rb

Index: ruby_1_8/ChangeLog
===================================================================
--- ruby_1_8/ChangeLog	(revision 27013)
+++ ruby_1_8/ChangeLog	(revision 27014)
@@ -1,3 +1,7 @@
+Mon Mar 22 19:32:34 2010  Tadayoshi Funaba  <tadf@d...>
+
+	* lib/date.rb (Date#>>): fixed.  [ruby-core:28011]
+
 Sat Mar 20 12:30:54 2010  Nobuyoshi Nakada  <nobu@r...>
 
 	* lib: fixed typo.  a patch by Sho Hashimoto in [ruby-dev:40716].
Index: ruby_1_8/lib/date.rb
===================================================================
--- ruby_1_8/lib/date.rb	(revision 27013)
+++ ruby_1_8/lib/date.rb	(revision 27014)
@@ -1,7 +1,7 @@
 #
 # date.rb - date and time library
 #
-# Author: Tadayoshi Funaba 1998-2008
+# Author: Tadayoshi Funaba 1998-2010
 #
 # Documentation: William Webber <william@w...>
 #
@@ -1305,7 +1305,10 @@
     y, m = (year * 12 + (mon - 1) + n).divmod(12)
     m,   = (m + 1)                    .divmod(1)
     d = mday
-    d -= 1 until jd2 = self.class.valid_civil?(y, m, d, fix_style)
+    until jd2 = self.class.valid_civil?(y, m, d, fix_style)
+      d -= 1
+      raise ArgumentError, 'invalid date' unless d > 0
+    end
     self + (jd2 - jd)
   end
 

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

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