From 8de1ee21e45c66b51e0dbd3d49aa50e5f42ea2c3 Mon Sep 17 00:00:00 2001 From: yugui Date: Sun, 16 Jan 2011 12:35:36 +0000 Subject: [PATCH] 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 --- ChangeLog | 5 +++++ lib/net/imap.rb | 4 ++-- version.h | 2 +- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 33ff1132f7..33775f8b34 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Fri Jan 14 14:56:57 2011 NARUSE, Yui + + * lib/net/imap.rb: use bytesize for binary strings. + patched by Yoshimasa Niwa. [ruby-core:34222] + Fri Jan 14 13:38:58 2011 NARUSE, Yui * ext/zlib/zlib.c (gzfile_check_footer): ISIZE (Input SIZE) in 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, "\\\\\\&") + '"' diff --git a/version.h b/version.h index babb1b7528..83a1e51ef7 100644 --- a/version.h +++ b/version.h @@ -1,5 +1,5 @@ #define RUBY_VERSION "1.9.2" -#define RUBY_PATCHLEVEL 156 +#define RUBY_PATCHLEVEL 157 #define RUBY_VERSION_MAJOR 1 #define RUBY_VERSION_MINOR 9 #define RUBY_VERSION_TEENY 1