Project

General

Profile

Bug #4249 » imap.rb.patch

niw (Yoshimasa Niwa), 01/07/2011 10:06 PM

View differences:

lib/net/imap.rb (working copy)
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)
......
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, "\\\\\\&") + '"'
(2-2/2)