Skip to content
Browse files

Fixed the bug of sprintf. "#" flag should be ignored with "dDiuU" for…

…mat.

Test Script:
{{{
require 'test/unit/assertions.rb'
include Test::Unit::Assertions

assert_equal("-0000123", sprintf("%#+08u", -123))
assert_equal("-0000123", sprintf("%#+08d", -123))
assert_equal("-0000123", sprintf("%#+08i", -123))

puts :ok
}}}

git-svn-id: http://svn.macosforge.org/repository/ruby/MacRuby/trunk@5172 23306eb0-4c56-4727-a40e-e92c0eb68959
  • Loading branch information...
1 parent 1017c7f commit eaf4b4a4dc2423c66e459d62a38416817669b0fc @Watson1978 Watson1978 committed Jan 15, 2011
Showing with 1 addition and 0 deletions.
  1. +1 −0 sprintf.c
View
1 sprintf.c
@@ -625,6 +625,7 @@ rb_str_format(int argc, const VALUE *argv, VALUE fmt)
case 'U':
base = 10;
complete = true;
+ sharp_flag = false;
break;
case 'x':

0 comments on commit eaf4b4a

Please sign in to comment.
Something went wrong with that request. Please try again.