1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

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
This commit is contained in:
wyhaines 2010-06-08 16:54:21 +00:00
parent 13e40bdaa0
commit 44c8d6c4db
3 changed files with 12 additions and 5 deletions

View file

@ -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>

View file

@ -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

View file

@ -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