1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* vsnprintf.c (BSD_vfprintf): prec digits fractal part should be

appended to 0 if prec is given.  [ruby-dev:42453] #3979

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29587 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2010-10-24 21:21:40 +00:00
parent df26e9d44e
commit bbf0fd4e9c
3 changed files with 12 additions and 1 deletions

View file

@ -1,3 +1,8 @@
Mon Oct 25 06:21:35 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
* vsnprintf.c (BSD_vfprintf): prec digits fractal part should be
appended to 0 if prec is given. [ruby-dev:42453] #3979
Mon Oct 25 02:57:21 2010 Koichi Sasada <ko1@atdot.net>
* common.mk (run.gdb): Quit gdb on 'make gdb' when

View file

@ -230,6 +230,10 @@ class TestSprintf < Test::Unit::TestCase
assert_equal("0x1.p+0", sprintf("%#.0a", 1), bug3965)
assert_equal("0x00000000000000.p+0", sprintf("%#020a", 0), bug3965)
assert_equal("0x0000.0000000000p+0", sprintf("%#020.10a", 0), bug3965)
bug3979 = '[ruby-dev:42453]'
assert_equal(" 0x0.000p+0", sprintf("%20.3a", 0), bug3979)
assert_equal(" 0x1.000p+0", sprintf("%20.3a", 1), bug3979)
end
BSIZ = 120

View file

@ -784,8 +784,10 @@ reswitch: switch (ch) {
#ifdef FLOATING_POINT
case 'a':
case 'A':
if (prec >= 0)
if (prec >= 0) {
flags |= ALT;
prec++;
}
goto fp_begin;
case 'e': /* anomalous precision */
case 'E':