ruby-changes:7384
From: shugo <ko1@a...>
Date: Fri, 29 Aug 2008 00:04:11 +0900 (JST)
Subject: [ruby-changes:7384] Ruby:r18903 (trunk): * strftime.c (rb_strftime): Time.mktime(2000).strftime("%-S") should
shugo 2008-08-29 00:01:07 +0900 (Fri, 29 Aug 2008) New Revision: 18903 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=18903 Log: * strftime.c (rb_strftime): Time.mktime(2000).strftime("%-S") should return "0", not "". Modified files: trunk/ChangeLog trunk/strftime.c trunk/test/ruby/test_time.rb Index: ChangeLog =================================================================== --- ChangeLog (revision 18902) +++ ChangeLog (revision 18903) @@ -1,3 +1,10 @@ +Thu Aug 28 23:55:50 2008 Shugo Maeda <shugo@r...> + + * strftime.c (rb_strftime): Time.mktime(2000).strftime("%-S") should + return "0", not "". + + * test/ruby/test_time.rb: ditto. + Thu Aug 28 23:55:22 2008 Yusuke Endoh <mame@t...> * test/ruby/test_time.rb: suppress warning during test. Index: strftime.c =================================================================== --- strftime.c (revision 18902) +++ strftime.c (revision 18903) @@ -275,7 +275,7 @@ do { \ int l; \ if (precision <= 0) precision = (def_prec); \ - if (flags & BIT_OF(LEFT)) precision = 0; \ + if (flags & BIT_OF(LEFT)) precision = 1; \ l = snprintf(s, endp - s, \ ((!padding || padding == (def_pad)) ? "%.*"fmt : "%*"fmt), \ precision, val); \ Index: test/ruby/test_time.rb =================================================================== --- test/ruby/test_time.rb (revision 18902) +++ test/ruby/test_time.rb (revision 18903) @@ -382,6 +382,7 @@ assert_equal("2000", T2000.strftime("%Y")) assert_equal("UTC", T2000.strftime("%Z")) assert_equal("%", T2000.strftime("%%")) + assert_equal("0", T2000.strftime("%-S")) assert_equal("", T2000.strftime("")) assert_equal("foo\0bar\x0000\x0000\x0000", T2000.strftime("foo\0bar\0%H\0%M\0%S")) -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/