aboutsummaryrefslogtreecommitdiffstats
path: root/lib/tempfile.rb
diff options
context:
space:
mode:
authorglass <glass@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-03-14 12:53:32 +0000
committerglass <glass@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-03-14 12:53:32 +0000
commitb688003aa19c5f30780821e54f5f60470fc8a8aa (patch)
tree9d71ba2ecbcba860da5f56f875e6060b6f04ebec /lib/tempfile.rb
parent2f61481929483c0bbbaf24bdd317217c84c2b2af (diff)
downloadruby-b688003aa19c5f30780821e54f5f60470fc8a8aa.tar.gz
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/trunk@57972 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/tempfile.rb')
-rw-r--r--lib/tempfile.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/tempfile.rb b/lib/tempfile.rb
index d068dd603c..b36c6638b6 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