summaryrefslogtreecommitdiff
path: root/lib/net
diff options
context:
space:
mode:
authornaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-01-14 05:57:50 +0000
committernaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-01-14 05:57:50 +0000
commit2661691698568ed745d89ad5bc7663c3746185db (patch)
treec8229b647e92d8b943a5826492966e68ee1e9b85 /lib/net
parent2dbf7d11f2df4a4f4f40ff7b688097ede497cb35 (diff)
downloadruby-2661691698568ed745d89ad5bc7663c3746185db.tar.gz
* lib/net/imap.rb: use bytesize for binary strings.
patched by Yoshimasa Niwa. [ruby-core:34222] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30543 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/net')
-rw-r--r--lib/net/imap.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/net/imap.rb b/lib/net/imap.rb
index dd0d6b42b7..0b76a9ff4a 100644
--- a/lib/net/imap.rb
+++ b/lib/net/imap.rb
@@ -1269,7 +1269,7 @@ module Net
end
def send_literal(str)
- put_string("{" + str.length.to_s + "}" + CRLF)
+ put_string("{" + str.bytesize.to_s + "}" + CRLF)
@continuation_request_arrival.wait
raise @exception if @exception
put_string(str)
@@ -2603,7 +2603,7 @@ module Net
return '""'
when /[\x80-\xff\r\n]/n
# literal
- return "{" + str.length.to_s + "}" + CRLF + str
+ return "{" + str.bytesize.to_s + "}" + CRLF + str
when /[(){ \x00-\x1f\x7f%*"\\]/n
# quoted string
return '"' + str.gsub(/["\\]/n, "\\\\\\&") + '"'