From 78492e51d818c193eb0b2a2546c6016c07a46fcd Mon Sep 17 00:00:00 2001 From: shyouhei Date: Tue, 8 Jun 2010 04:45:42 +0000 Subject: merge revision(s) 27014: * lib/date.rb (Date#>>): fixed. [ruby-core:28011] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_7@28204 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 4 ++++ lib/date.rb | 7 +++++-- version.h | 2 +- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index f462cf9c8b..f302c6a224 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +Tue Jun 8 13:40:04 2010 Tadayoshi Funaba + + * lib/date.rb (Date#>>): fixed. [ruby-core:28011] + Tue Jun 8 12:37:56 2010 NARUSE, Yui * io.c, eval.c, process.c: add linux to r26371's condition. diff --git a/lib/date.rb b/lib/date.rb index 19991d60b4..37c7630895 100644 --- a/lib/date.rb +++ b/lib/date.rb @@ -1,7 +1,7 @@ # # date.rb - date and time library # -# Author: Tadayoshi Funaba 1998-2008 +# Author: Tadayoshi Funaba 1998-2010 # # Documentation: William Webber # @@ -1305,7 +1305,10 @@ 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 cc21317b8b..34b911f770 100644 --- a/version.h +++ b/version.h @@ -2,7 +2,7 @@ #define RUBY_RELEASE_DATE "2010-06-08" #define RUBY_VERSION_CODE 187 #define RUBY_RELEASE_CODE 20100608 -#define RUBY_PATCHLEVEL 269 +#define RUBY_PATCHLEVEL 270 #define RUBY_VERSION_MAJOR 1 #define RUBY_VERSION_MINOR 8 -- cgit v1.2.3