ruby-changes:36247
From: nobu <ko1@a...>
Date: Sun, 9 Nov 2014 10:31:11 +0900 (JST)
Subject: [ruby-changes:36247] nobu:r48328 (trunk): securerandom.rb: fix substring of FormatMessage result
nobu 2014-11-09 10:31:05 +0900 (Sun, 09 Nov 2014) New Revision: 48328 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=48328 Log: securerandom.rb: fix substring of FormatMessage result * lib/securerandom.rb: set the script encoding to make a string literal in SecureRandom::Kernel32.last_error_message single byte encoding so msg[] works in bytes, since FormatMessage() returns the size in TCHARs, not in characters. Modified files: trunk/ChangeLog trunk/lib/securerandom.rb Index: ChangeLog =================================================================== --- ChangeLog (revision 48327) +++ ChangeLog (revision 48328) @@ -1,3 +1,10 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1 +Sun Nov 9 10:31:03 2014 Nobuyoshi Nakada <nobu@r...> + + * lib/securerandom.rb: set the script encoding to make a string + literal in SecureRandom::Kernel32.last_error_message single byte + encoding so msg[] works in bytes, since FormatMessage() returns + the size in TCHARs, not in characters. + Sun Nov 9 09:50:22 2014 Tanaka Akira <akr@f...> * test/webrick: Refine log tests. Index: lib/securerandom.rb =================================================================== --- lib/securerandom.rb (revision 48327) +++ lib/securerandom.rb (revision 48328) @@ -1,3 +1,4 @@ https://github.com/ruby/ruby/blob/trunk/lib/securerandom.rb#L1 +# -*- coding: us-ascii -*- begin require 'openssl' rescue LoadError -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/