ruby-changes:8867
From: yugui <ko1@a...>
Date: Sun, 30 Nov 2008 18:23:31 +0900 (JST)
Subject: [ruby-changes:8867] Ruby:r20402 (ruby_1_9_1): merges r20339 from trunk into ruby_1_9_1.
yugui 2008-11-30 18:21:48 +0900 (Sun, 30 Nov 2008) New Revision: 20402 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=20402 Log: merges r20339 from trunk into ruby_1_9_1. * strftime.c (rb_strftime): The precision of %0N should be 9. [ruby-dev:37156] Modified files: branches/ruby_1_9_1/ChangeLog branches/ruby_1_9_1/strftime.c branches/ruby_1_9_1/test/ruby/test_time.rb Index: ruby_1_9_1/ChangeLog =================================================================== --- ruby_1_9_1/ChangeLog (revision 20401) +++ ruby_1_9_1/ChangeLog (revision 20402) @@ -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: ruby_1_9_1/strftime.c =================================================================== --- ruby_1_9_1/strftime.c (revision 20401) +++ ruby_1_9_1/strftime.c (revision 20402) @@ -673,8 +673,7 @@ { long n = ts->tv_nsec; - if (precision == 0) continue; - if (precision < 0) { + if (precision <= 0) { precision = w; } NEEDS(precision); Index: ruby_1_9_1/test/ruby/test_time.rb =================================================================== --- ruby_1_9_1/test/ruby/test_time.rb (revision 20401) +++ ruby_1_9_1/test/ruby/test_time.rb (revision 20402) @@ -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/