summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorwyhaines <wyhaines@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-06-08 16:54:21 +0000
committerwyhaines <wyhaines@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-06-08 16:54:21 +0000
commit44c8d6c4dbc75555ab2993ca1b39c42771313437 (patch)
tree919a6066fc218ab3d01a1adb7786cd3040a522e8
parent13e40bdaa08d004edb45c2be872a812236296f31 (diff)
lib/date.rb: Backport #2707 [ruby-core:28011]; backport r27014 to fix problem with Date#>> and very small numbers.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_6@28233 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog9
-rw-r--r--lib/date.rb6
-rw-r--r--version.h2
3 files changed, 12 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog
index 1f4a1ea319..46e1b69454 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,8 +1,11 @@
-Wed June 9 01:05:00 Kirk Haines <khaines@ruby-lang.org>
+Wed Jun 9 01:42:00 Kirk Haines <khaines@ruby-lang.org>
- * 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@ruby-lang.org>
+
+ * 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@ruby-lang.org>
diff --git a/lib/date.rb b/lib/date.rb
index ea557313f7..d562fd12b1 100644
--- a/lib/date.rb
+++ b/lib/date.rb
@@ -1273,7 +1273,11 @@ class Date
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
diff --git a/version.h b/version.h
index 17d77ddd83..895312bebf 100644
--- a/version.h
+++ b/version.h
@@ -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