summaryrefslogtreecommitdiffstats
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
commit8ebda2064fabf5b9edc36d8400e603f7482a7072 (patch)
tree8c3ee05e74e705fdaa81800f7a153e40de31df5d /sprintf.c
parent349af96c641c6fc0853ba03b0d7d497181b5a63e (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: http://svn.ruby-lang.org/repos/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 aebb9d5e6..f4143a98c 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);