diff options
author | normal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-01-30 00:22:22 +0000 |
---|---|---|
committer | normal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-01-30 00:22:22 +0000 |
commit | 7830a950efa6d312e7c662beabaa0f8d7b4e0a23 (patch) | |
tree | 46441edb4ccbaa2e4cfe271c2b093e6b289e2c8d /lib | |
parent | f65c682fbdedba843af1b296e64729649a229af9 (diff) | |
download | ruby-7830a950efa6d312e7c662beabaa0f8d7b4e0a23.tar.gz |
net/pop: make modified strings mutable
Thanks to Michael Zimmerman for the bug report
* lib/net/pop.rb: make modified strings mutable
[ruby-core:85210] [Bug #14416]
* test/net/pop/test_pop.rb: new test
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62099 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
-rw-r--r-- | lib/net/pop.rb | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/net/pop.rb b/lib/net/pop.rb index 55597f2fab..92a4fe7303 100644 --- a/lib/net/pop.rb +++ b/lib/net/pop.rb @@ -467,7 +467,7 @@ module Net # Provide human-readable stringification of class state. def inspect - "#<#{self.class} #{@address}:#{@port} open=#{@started}>" + +"#<#{self.class} #{@address}:#{@port} open=#{@started}>" end # *WARNING*: This method causes a serious security hole. @@ -758,7 +758,7 @@ module Net # Provide human-readable stringification of class state. def inspect - "#<#{self.class} #{@number}#{@deleted ? ' deleted' : ''}>" + +"#<#{self.class} #{@number}#{@deleted ? ' deleted' : ''}>" end # @@ -799,7 +799,7 @@ module Net # # This method raises a POPError if an error occurs. # - def pop( dest = '', &block ) # :yield: message_chunk + def pop( dest = +'', &block ) # :yield: message_chunk if block_given? @command.retr(@number, &block) nil @@ -819,7 +819,7 @@ module Net # The optional +dest+ argument is obsolete. # # This method raises a POPError if an error occurs. - def top(lines, dest = '') + def top(lines, dest = +'') @command.top(@number, lines) do |chunk| dest << chunk end @@ -831,7 +831,7 @@ module Net # The optional +dest+ argument is obsolete. # # This method raises a POPError if an error occurs. - def header(dest = '') + def header(dest = +'') top(0, dest) end @@ -898,7 +898,7 @@ module Net attr_reader :socket def inspect - "#<#{self.class} socket=#{@socket}>" + +"#<#{self.class} socket=#{@socket}>" end def auth(account, password) |