summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-03-28 05:41:54 +0000
committerusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-03-28 05:41:54 +0000
commit08987d3105c72cf2583c5df27bfc40d1724137ec (patch)
tree24134ca28874cd3cc5185a74db350a52d2ff3b80 /lib
parentf444a7ab9803ae71211018a1ce72accbf523ae12 (diff)
merge revision(s) 61639: [Backport #14323]
net/ftp: fix FrozenError in BufferedSocket I noticed this bug while working on something else with RUBYOPT=-d on, existing test cases all passed with it. Note: I use String.new because it is the local style, here, I prefer +'' (or ''.b, for a future commit) * lib/net/ftp.rb (BufferedSocket#read): use String.new * test/net/ftp/test_buffered_socket.rb (test_read_nil): new test [Bug #14323] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_3@62943 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
-rw-r--r--lib/net/ftp.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/net/ftp.rb b/lib/net/ftp.rb
index 0437e9504e..b25db9ad3c 100644
--- a/lib/net/ftp.rb
+++ b/lib/net/ftp.rb
@@ -1297,7 +1297,7 @@ module Net
s = super(len, String.new, true)
return s.empty? ? nil : s
else
- result = ""
+ result = String.new
while s = super(DEFAULT_BLOCKSIZE, String.new, true)
break if s.empty?
result << s