[前][次][番号順一覧][スレッド一覧]

ruby-changes:39503

From: nobu <ko1@a...>
Date: Sat, 15 Aug 2015 10:51:21 +0900 (JST)
Subject: [ruby-changes:39503] nobu:r51584 (trunk): win32/registry.rb: size in bytes

nobu	2015-08-15 10:51:10 +0900 (Sat, 15 Aug 2015)

  New Revision: 51584

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=51584

  Log:
    win32/registry.rb: size in bytes
    
    * ext/win32/lib/win32/registry.rb (API#SetValue): data size should
      be in bytes, not in chars.  [ruby-core:70365] [Bug #11439]

  Modified files:
    trunk/ChangeLog
    trunk/ext/win32/lib/win32/registry.rb
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 51583)
+++ ChangeLog	(revision 51584)
@@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Sat Aug 15 10:51:08 2015  Nobuyoshi Nakada  <nobu@r...>
+
+	* ext/win32/lib/win32/registry.rb (API#SetValue): data size should
+	  be in bytes, not in chars.  [ruby-core:70365] [Bug #11439]
+
 Sat Aug 15 10:15:20 2015  Nobuyoshi Nakada  <nobu@r...>
 
 	* io.c (rb_io_each_codepoint): read more data when read partially.
Index: ext/win32/lib/win32/registry.rb
===================================================================
--- ext/win32/lib/win32/registry.rb	(revision 51583)
+++ ext/win32/lib/win32/registry.rb	(revision 51584)
@@ -326,7 +326,7 @@ For detail, see the MSDN[http://msdn.mic https://github.com/ruby/ruby/blob/trunk/ext/win32/lib/win32/registry.rb#L326
         case type
         when REG_SZ, REG_EXPAND_SZ, REG_MULTI_SZ
           data = data.encode(WCHAR)
-          size ||= data.size + WCHAR_SIZE
+          size ||= data.bytesize + WCHAR_SIZE
         end
         check RegSetValueExW.call(hkey, make_wstr(name), 0, type, data, size)
       end

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]