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

ruby-changes:29819

From: tadf <ko1@a...>
Date: Wed, 10 Jul 2013 06:24:53 +0900 (JST)
Subject: [ruby-changes:29819] tadf:r41871 (trunk): * ext/date/date_parse.c (date_zone_to_diff): .

tadf	2013-07-10 06:24:35 +0900 (Wed, 10 Jul 2013)

  New Revision: 41871

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

  Log:
    * ext/date/date_parse.c (date_zone_to_diff): [ruby-core:55831].

  Modified files:
    trunk/ChangeLog
    trunk/ext/date/date_parse.c
    trunk/test/date/test_date_parse.rb

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 41870)
+++ ChangeLog	(revision 41871)
@@ -1,3 +1,7 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Wed Jul 10 06:22:27 2013  Tadayoshi Funaba  <tadf@d...>
+
+	* ext/date/date_parse.c (date_zone_to_diff): [ruby-core:55831].
+
 Wed Jul 10 00:41:42 2013  Tanaka Akira  <akr@f...>
 
 	* bignum.c (bary_mul): x*1 is x.
Index: ext/date/date_parse.c
===================================================================
--- ext/date/date_parse.c	(revision 41870)
+++ ext/date/date_parse.c	(revision 41871)
@@ -569,7 +569,7 @@ date_zone_to_diff(VALUE str) https://github.com/ruby/ruby/blob/trunk/ext/date/date_parse.c#L569
 			if (cl >= 3)
 			    min  = rb_str_new(&cs[1], 2);
 			if (cl >= 5)
-			    min  = rb_str_new(&cs[3], 2);
+			    sec  = rb_str_new(&cs[3], 2);
 		    }
 		    else {
 			if (cl >= 2)
Index: test/date/test_date_parse.rb
===================================================================
--- test/date/test_date_parse.rb	(revision 41870)
+++ test/date/test_date_parse.rb	(revision 41871)
@@ -578,6 +578,15 @@ class TestDateParse < Test::Unit::TestCa https://github.com/ruby/ruby/blob/trunk/test/date/test_date_parse.rb#L578
     assert_equal(d2, d1)
   end
 
+  def test__parse_odd_offset
+    h = DateTime._parse('2001-02-03T04:05:06+1')
+    assert_equal(3600, h[:offset])
+    h = DateTime._parse('2001-02-03T04:05:06+123')
+    assert_equal(4980, h[:offset])
+    h = DateTime._parse('2001-02-03T04:05:06+12345')
+    assert_equal(5025, h[:offset])
+  end
+
   require 'time'
 
   def test_parse__time

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

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