summaryrefslogtreecommitdiff
path: root/sprintf.c
diff options
context:
space:
mode:
authoryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-05-04 12:31:16 +0000
committeryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-05-04 12:31:16 +0000
commitb28ac942ef90c255f26c7bbfbf27046740a72da5 (patch)
tree8c3ee05e74e705fdaa81800f7a153e40de31df5d /sprintf.c
parent184abbe8a30938a5d7c79da333285b85cb7f00e3 (diff)
merges r23186 and r23187 from trunk into ruby_1_9_1.
-- * sprintf.c (rb_str_format): check encoding compatibility only on real parts. -- * sprintf.c (rb_str_format): optimize previous commit. [ruby-list:45954] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_1@23341 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'sprintf.c')
-rw-r--r--sprintf.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/sprintf.c b/sprintf.c
index aebb9d5e66..f4143a98c8 100644
--- a/sprintf.c
+++ b/sprintf.c
@@ -652,6 +652,7 @@ rb_str_format(int argc, const VALUE *argv, VALUE fmt)
str = rb_obj_as_string(arg);
if (OBJ_TAINTED(str)) tainted = 1;
len = RSTRING_LEN(str);
+ rb_str_set_len(result, blen);
enc = rb_enc_check(result, str);
if (flags&(FPREC|FWIDTH)) {
slen = rb_enc_strlen(RSTRING_PTR(str),RSTRING_END(str),enc);