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

ruby-changes:16265

From: wyhaines <ko1@a...>
Date: Wed, 9 Jun 2010 01:55:36 +0900 (JST)
Subject: [ruby-changes:16265] Ruby:r28233 (ruby_1_8_6): lib/date.rb: Backport #2707 ; backport r27014 to fix problem with Date#>> and very small numbers.

wyhaines	2010-06-09 01:54:21 +0900 (Wed, 09 Jun 2010)

  New Revision: 28233

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

  Log:
    lib/date.rb:  Backport #2707 [ruby-core:28011]; backport r27014 to fix problem with Date#>> and very small numbers.

  Modified files:
    branches/ruby_1_8_6/ChangeLog
    branches/ruby_1_8_6/lib/date.rb
    branches/ruby_1_8_6/version.h

Index: ruby_1_8_6/ChangeLog
===================================================================
--- ruby_1_8_6/ChangeLog	(revision 28232)
+++ ruby_1_8_6/ChangeLog	(revision 28233)
@@ -1,9 +1,12 @@
-Wed June 9 01:05:00 Kirk Haines <khaines@r...>
+Wed Jun 9 01:42:00 Kirk Haines <khaines@r...>
 
-	* lib/monitor.rb:  Backport #2240 [ruby-core:26185]; backport r25420 to ensure that the scheduled thread is alive when a monitor is released.
-	* test/monitor/test_monitor.rb: Backport #2240 [ruby-core:26185]; added a test for the above functionality.
+	* lib/date.rb:  Backport #2707 [ruby-core:28011]; backport r27014 to fix problem with Date#>> and very small numbers.
 
+Wed Jun 9 01:05:00 Kirk Haines <khaines@r...>
 
+	* lib/monitor.rb:  Backport #2240 [ruby-core:26185]; backport r25420 to ensure that the scheduled thread is alive when a monitor is released. r28232
+	* test/monitor/test_monitor.rb: Backport #2240 [ruby-core:26185]; added a test for the above functionality. r28232
+
 Tue Jun 8 23:45:00 2010 Kirk Haines <khaines@r...>
 
 	* regexp.c: Backport #3403; backported from r28192 to fix a bug with non-greedy matching. r28231
Index: ruby_1_8_6/version.h
===================================================================
--- ruby_1_8_6/version.h	(revision 28232)
+++ ruby_1_8_6/version.h	(revision 28233)
@@ -2,7 +2,7 @@
 #define RUBY_RELEASE_DATE "2010-06-09"
 #define RUBY_VERSION_CODE 186
 #define RUBY_RELEASE_CODE 20100609
-#define RUBY_PATCHLEVEL 408
+#define RUBY_PATCHLEVEL 409
 
 #define RUBY_VERSION_MAJOR 1
 #define RUBY_VERSION_MINOR 8
Index: ruby_1_8_6/lib/date.rb
===================================================================
--- ruby_1_8_6/lib/date.rb	(revision 28232)
+++ ruby_1_8_6/lib/date.rb	(revision 28233)
@@ -1273,7 +1273,11 @@
     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/

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