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

* sprintf.c (rb_str_format): fix: sprintf with hex format and

precision includes wrong dots.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29502 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
naruse 2010-10-15 08:28:12 +00:00
parent ccaf61d5af
commit a160986d90
4 changed files with 19 additions and 14 deletions

View file

@ -190,7 +190,7 @@ class TestSprintfComb < Test::Unit::TestCase
if digits.last != radix-1
digits << (radix-1)
end
sign = '..'
sign = '..' unless precision
else
sign = '-'
end
@ -222,8 +222,8 @@ class TestSprintfComb < Test::Unit::TestCase
end
end
if type == 'o' && hs
if digits.empty? || digits.last != d
digits << d
if digits.empty? || digits.last != 0
prefix = '0'
end
end