summaryrefslogtreecommitdiff
path: root/lib/net
diff options
context:
space:
mode:
authornagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-03-20 17:55:34 +0000
committernagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-03-20 17:55:34 +0000
commitb1612cedd915303734d8b2a4fd5a0f9ac91507ad (patch)
treeff73fe181bbca09888dd3a962cf0bd2430741a78 /lib/net
parentf634fc1f8af020d24f3517249e567316e35e196a (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 [ruby-core:84675] [Bug #14323] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_4@62867 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/net')
-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 bd74323987..31f93b8b34 100644
--- a/lib/net/ftp.rb
+++ b/lib/net/ftp.rb
@@ -1434,7 +1434,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