ruby-changes:8803
From: shugo <ko1@a...>
Date: Mon, 24 Nov 2008 22:10:24 +0900 (JST)
Subject: [ruby-changes:8803] Ruby:r20339 (trunk): * strftime.c (rb_strftime): The precision of %0N should be 9.
shugo 2008-11-24 22:10:07 +0900 (Mon, 24 Nov 2008) New Revision: 20339 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=20339 Log: * strftime.c (rb_strftime): The precision of %0N should be 9. [ruby-dev:37156] Modified files: trunk/ChangeLog trunk/strftime.c trunk/test/ruby/test_time.rb Index: ChangeLog =================================================================== --- ChangeLog (revision 20338) +++ ChangeLog (revision 20339) @@ -1,3 +1,10 @@ +Mon Nov 24 22:07:07 2008 Shugo Maeda <shugo@r...> + + * strftime.c (rb_strftime): The precision of %0N should be 9. + [ruby-dev:37156] + + * test/ruby/test_time.rb (test_strftime): ditto. + Mon Nov 24 21:38:23 2008 Shugo Maeda <shugo@r...> * strftime.c (rb_strftime): The default precision should be 1, not Index: strftime.c =================================================================== --- strftime.c (revision 20338) +++ strftime.c (revision 20339) @@ -673,8 +673,7 @@ { long n = ts->tv_nsec; - if (precision == 0) continue; - if (precision < 0) { + if (precision <= 0) { precision = w; } NEEDS(precision); Index: test/ruby/test_time.rb =================================================================== --- test/ruby/test_time.rb (revision 20338) +++ test/ruby/test_time.rb (revision 20339) @@ -396,7 +396,7 @@ assert_equal("123456", t.strftime("%6N")) assert_equal("123456789", t.strftime("%9N")) assert_equal("1234567890", t.strftime("%10N")) - assert_equal("", t.strftime("%0N")) + assert_equal("123456789", t.strftime("%0N")) assert_equal("000", t.strftime("%3S")) assert_equal("946684800", t.strftime("%s")) assert_equal("946684800", t.utc.strftime("%s")) -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/