1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* 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
This commit is contained in:
naruse 2011-01-14 05:57:50 +00:00
parent 2dbf7d11f2
commit 2661691698
2 changed files with 7 additions and 2 deletions

View file

@ -1,3 +1,8 @@
Fri Jan 14 14:56:57 2011 NARUSE, Yui <naruse@ruby-lang.org>
* lib/net/imap.rb: use bytesize for binary strings.
patched by Yoshimasa Niwa. [ruby-core:34222]
Fri Jan 14 14:01:12 2011 NARUSE, Yui <naruse@ruby-lang.org>
* pack.c (pack_unpack): the resulted string of unpack('M') must have

View file

@ -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, "\\\\\\&") + '"'