ruby-changes:18520
From: naruse <ko1@a...>
Date: Fri, 14 Jan 2011 15:04:55 +0900 (JST)
Subject: [ruby-changes:18520] Ruby:r30543 (trunk): * lib/net/imap.rb: use bytesize for binary strings.
naruse 2011-01-14 14:57:50 +0900 (Fri, 14 Jan 2011) New Revision: 30543 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=30543 Log: * lib/net/imap.rb: use bytesize for binary strings. patched by Yoshimasa Niwa. [ruby-core:34222] Modified files: trunk/ChangeLog trunk/lib/net/imap.rb Index: ChangeLog =================================================================== --- ChangeLog (revision 30542) +++ ChangeLog (revision 30543) @@ -1,3 +1,8 @@ +Fri Jan 14 14:56:57 2011 NARUSE, Yui <naruse@r...> + + * 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@r...> * pack.c (pack_unpack): the resulted string of unpack('M') must have Index: lib/net/imap.rb =================================================================== --- lib/net/imap.rb (revision 30542) +++ lib/net/imap.rb (revision 30543) @@ -1269,7 +1269,7 @@ 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 @@ 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, "\\\\\\&") + '"' -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/