diff options
author | normal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-01-06 09:21:35 +0000 |
---|---|---|
committer | normal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-01-06 09:21:35 +0000 |
commit | e56d34001fd924a4b62f0c846f55174bb8c6d3c8 (patch) | |
tree | 3d9a3b7230457e2aeb91bca12b066e5b5de50ddc /lib/net | |
parent | 7d34bdb81d40f8a9bf61cef8e839093815b7211f (diff) |
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/trunk@61639 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/net')
-rw-r--r-- | lib/net/ftp.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/net/ftp.rb b/lib/net/ftp.rb index ee7f029f88..c3ee47ef4d 100644 --- a/lib/net/ftp.rb +++ b/lib/net/ftp.rb @@ -1428,7 +1428,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 |