diff options
author | shugo <shugo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-05-11 12:39:23 +0000 |
---|---|---|
committer | shugo <shugo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-05-11 12:39:23 +0000 |
commit | 59630683d65f3e18b8ad79bbca595a8133981cca (patch) | |
tree | 2de989f34b9e66e1b8d3618d94ddf3b3ac536be8 /lib/net | |
parent | b787be4e45d89125858757cbcecab06df809a96f (diff) | |
download | bundler-59630683d65f3e18b8ad79bbca595a8133981cca.tar.gz |
net/imap: Fix ArgumentError in send_string_data
Thanks to ShockwaveNN (Pavel Lobashov) for reporting the bug.
[ruby-core:86990] [Bug #14750]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63396 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/net')
-rw-r--r-- | lib/net/imap.rb | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/net/imap.rb b/lib/net/imap.rb index b42186dce0..61ce520177 100644 --- a/lib/net/imap.rb +++ b/lib/net/imap.rb @@ -1325,11 +1325,11 @@ module Net when nil put_string("NIL") when String - send_string_data(data) + send_string_data(data, tag) when Integer send_number_data(data) when Array - send_list_data(data) + send_list_data(data, tag) when Time send_time_data(data) when Symbol @@ -1339,13 +1339,13 @@ module Net end end - def send_string_data(str) + def send_string_data(str, tag = nil) case str when "" put_string('""') when /[\x80-\xff\r\n]/n # literal - send_literal(str) + send_literal(str, tag) when /[(){ \x00-\x1f\x7f%*"\\]/n # quoted string send_quoted_string(str) @@ -1358,7 +1358,7 @@ module Net put_string('"' + str.gsub(/["\\]/n, "\\\\\\&") + '"') end - def send_literal(str, tag) + def send_literal(str, tag = nil) synchronize do put_string("{" + str.bytesize.to_s + "}" + CRLF) @continued_command_tag = tag @@ -1379,7 +1379,7 @@ module Net put_string(num.to_s) end - def send_list_data(list) + def send_list_data(list, tag = nil) put_string("(") first = true list.each do |i| @@ -1388,7 +1388,7 @@ module Net else put_string(" ") end - send_data(i) + send_data(i, tag) end put_string(")") end |