diff options
author | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-03-18 12:02:27 +0000 |
---|---|---|
committer | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-03-18 12:02:27 +0000 |
commit | 8be9bd482eee91c503f623bb3b802c9fa8e371b2 (patch) | |
tree | 98fb76109ded56380ba6865a2131b2fd351072f4 /lib | |
parent | 147107ce36eb1231fb79af066ab172d5003d3a1a (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_4@58013 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 36b0e1a481..38d6e5ce24 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 |