diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-03-06 08:26:55 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-03-06 08:26:55 +0000 |
commit | ec2205b2052ddf72685e6e6f1c25d0b3c19de831 (patch) | |
tree | d649ed2369bee201643b7727ee7f7b6bca853b28 /sprintf.c | |
parent | fe2a671fdb1333914a2b751fefc6191c2c3c28e9 (diff) | |
download | ruby-ec2205b2052ddf72685e6e6f1c25d0b3c19de831.tar.gz |
* sprintf.c (rb_str_format): space flag is in effect for Inf/NaN too.
[ruby-dev:34002]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15720 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'sprintf.c')
-rw-r--r-- | sprintf.c | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -794,6 +794,8 @@ rb_str_format(int argc, const VALUE *argv, VALUE fmt) buf[blen + need - strlen(expr) - 1] = '-'; else if (flags & FPLUS) buf[blen + need - strlen(expr) - 1] = '+'; + else if ((flags & FSPACE) && need > width) + blen++; strncpy(&buf[blen + need - strlen(expr)], expr, strlen(expr)); } |