From 35adbb5f8890cfba80b35f3042f1fb45f91c8790 Mon Sep 17 00:00:00 2001 From: matz Date: Mon, 26 Nov 2007 09:38:49 +0000 Subject: [PATCH] * 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 --- ChangeLog | 5 +++++ sprintf.c | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index e767e1d1a7..3453677c01 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Mon Nov 26 18:38:00 2007 Yukihiro Matsumoto + + * sprintf.c (rb_str_format): always trim preceding zeros. + [ruby-dev:32351] + Mon Nov 26 17:32:16 2007 Tanaka Akira * re.c (Init_Regexp): new method Regexp#fixed_encoding? diff --git a/sprintf.c b/sprintf.c index 643314dc37..62731a5f26 100644 --- a/sprintf.c +++ b/sprintf.c @@ -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) {