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 | 5ebe489329be7fc6fbc8cef266f81b952a5e5aa7 (patch) | |
tree | d649ed2369bee201643b7727ee7f7b6bca853b28 | |
parent | a5ad15b9b336e8aad31af5544c6d01dc0ae6f524 (diff) | |
download | ruby-5ebe489329be7fc6fbc8cef266f81b952a5e5aa7.tar.gz ruby-5ebe489329be7fc6fbc8cef266f81b952a5e5aa7.tar.xz ruby-5ebe489329be7fc6fbc8cef266f81b952a5e5aa7.zip |
* sprintf.c (rb_str_format): space flag is in effect for Inf/NaN too.
[ruby-dev:34002]
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@15720 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | sprintf.c | 2 |
2 files changed, 7 insertions, 0 deletions
@@ -1,3 +1,8 @@ +Thu Mar 6 17:26:53 2008 Nobuyoshi Nakada <nobu@ruby-lang.org> + + * sprintf.c (rb_str_format): space flag is in effect for Inf/NaN too. + [ruby-dev:34002] + Thu Mar 6 15:44:20 2008 NAKAMURA Usaku <usa@ruby-lang.org> * sprintf.c (rb_str_format): casting double to long is undefined @@ -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)); } |