* sprintf.c (rb_str_format): always trim preceding zeros.

[ruby-dev:32351]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14022 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
matz 2007-11-26 09:38:49 +00:00
parent cbd72b86da
commit 35adbb5f88
2 changed files with 6 additions and 1 deletions

View File

@ -1,3 +1,8 @@
Mon Nov 26 18:38:00 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
* sprintf.c (rb_str_format): always trim preceding zeros.
[ruby-dev:32351]
Mon Nov 26 17:32:16 2007 Tanaka Akira <akr@fsij.org>
* re.c (Init_Regexp): new method Regexp#fixed_encoding?

View File

@ -662,7 +662,7 @@ rb_str_format(int argc, const VALUE *argv, VALUE fmt)
val = rb_big_clone(val);
rb_big_2comp(val);
}
tmp1 = tmp = rb_big2str0(val, base, RBIGNUM_SIGN(val));
tmp1 = tmp = rb_big2str0(val, base, Qtrue);
s = RSTRING_PTR(tmp);
if (*s == '-') {
if (base == 10) {