diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-05-13 22:27:10 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-05-13 22:27:10 +0000 |
commit | 4eb19660e9d736e7afb80f79a9b7cedfd6f7dabe (patch) | |
tree | d45658e0d1a2d4e8a4fe8ff7ff25f1d40a418322 /marshal.c | |
parent | ccbdebf5a97ae0e7433f09d61f65f05e58877ba8 (diff) | |
download | ruby-4eb19660e9d736e7afb80f79a9b7cedfd6f7dabe.tar.gz |
* marshal.c (w_float): strip ".0" from end for rubyspec.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27792 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'marshal.c')
-rw-r--r-- | marshal.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -369,7 +369,10 @@ w_float(double d, struct dump_arg *arg) else w_cstr("0", arg); } else { - w_bytes(buf, ruby_dbl2cstr(d, buf, (int)sizeof(buf)), arg); + int len = ruby_dbl2cstr(d, buf, (int)sizeof(buf)); + if (len > 2 && buf[len - 1] == '0' && buf[len - 2] == '.') + len -= 2; + w_bytes(buf, len, arg); } } |