summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authoryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-01-16 12:35:36 +0000
committeryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-01-16 12:35:36 +0000
commit8de1ee21e45c66b51e0dbd3d49aa50e5f42ea2c3 (patch)
treef0576927e617a7fd731ed99af2f24e96943c734e /lib
parentc303d3838b9fc8cc871bc68d9428902b601a18d0 (diff)
merges r30543 from trunk into ruby_1_9_2.
-- * 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/branches/ruby_1_9_2@30576 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
-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 3404700297..f28c99e679 100644
--- a/lib/net/imap.rb
+++ b/lib/net/imap.rb
@@ -1237,7 +1237,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)
@@ -2571,7 +2571,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, "\\\\\\&") + '"'