diff options
author | nagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-03-27 14:47:38 +0000 |
---|---|---|
committer | nagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-03-27 14:47:38 +0000 |
commit | 57d0c36a2821f01f71eda14695476af9a558365d (patch) | |
tree | 61abbdcd6104dfb6983608e87c0ada7ad9004397 /lib | |
parent | 316f37b18769d5a161df67ebe3edf502d043fc96 (diff) |
merge revision(s) 57972: [Backport #13198]
Fix bug of Tempfile#size if nothing is written [Bug #13198]
* lib/tempfile.rb (Tempfile#size): Fix its behavior when nothing
is written. Tempfile#size should return 0 in this case.
The patch is from nobu <nobu@ruby-lang.org>.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_3@58154 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
-rw-r--r-- | lib/tempfile.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/tempfile.rb b/lib/tempfile.rb index 223637f84a..a0f3fdd90a 100644 --- a/lib/tempfile.rb +++ b/lib/tempfile.rb @@ -227,7 +227,7 @@ class Tempfile < DelegateClass(File) if !@tmpfile.closed? @tmpfile.size # File#size calls rb_io_flush_raw() else - File.size?(@tmpfile.path) + File.size(@tmpfile.path) end end alias length size |