ruby-changes:18026
From: yugui <ko1@a...>
Date: Thu, 2 Dec 2010 17:08:31 +0900 (JST)
Subject: [ruby-changes:18026] Ruby:r30046 (ruby_1_9_2): merges r29495 from trunk into ruby_1_9_2.
yugui 2010-12-02 17:07:28 +0900 (Thu, 02 Dec 2010) New Revision: 30046 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=30046 Log: merges r29495 from trunk into ruby_1_9_2. -- * ext/win32ole/win32ole.c (reg_get_val): expand environment in the pathname. [Bug #3907] Modified files: branches/ruby_1_9_2/ChangeLog branches/ruby_1_9_2/ext/win32ole/win32ole.c branches/ruby_1_9_2/test/win32ole/test_win32ole_typelib.rb branches/ruby_1_9_2/version.h Index: ruby_1_9_2/ChangeLog =================================================================== --- ruby_1_9_2/ChangeLog (revision 30045) +++ ruby_1_9_2/ChangeLog (revision 30046) @@ -1,3 +1,8 @@ +Thu Oct 14 20:50:51 2010 Masaki Suketa <masaki.suketa@n...> + + * ext/win32ole/win32ole.c (reg_get_val): expand environment in + the pathname. [Bug #3907] + Thu Oct 14 04:16:41 2010 NARUSE, Yui <naruse@r...> * numeric.c (ruby_float_step): fix Numeric#step with infinity unit Index: ruby_1_9_2/ext/win32ole/win32ole.c =================================================================== --- ruby_1_9_2/ext/win32ole/win32ole.c (revision 30045) +++ ruby_1_9_2/ext/win32ole/win32ole.c (revision 30046) @@ -2338,6 +2338,13 @@ err = RegQueryValueEx(hkey, subkey, NULL, &dwtype, pbuf, &size); if (err == ERROR_SUCCESS) { pbuf[size] = '\0'; + if (dwtype == REG_EXPAND_SZ) { + char* pbuf2 = pbuf; + DWORD len = ExpandEnvironmentStrings(pbuf2, NULL, 0); + pbuf = ALLOC_N(char, len + 1); + ExpandEnvironmentStrings(pbuf2, pbuf, len + 1); + free(pbuf2); + } val = rb_str_new2(pbuf); } free(pbuf); Index: ruby_1_9_2/version.h =================================================================== --- ruby_1_9_2/version.h (revision 30045) +++ ruby_1_9_2/version.h (revision 30046) @@ -1,5 +1,5 @@ #define RUBY_VERSION "1.9.2" -#define RUBY_PATCHLEVEL 76 +#define RUBY_PATCHLEVEL 77 #define RUBY_VERSION_MAJOR 1 #define RUBY_VERSION_MINOR 9 #define RUBY_VERSION_TEENY 1 Index: ruby_1_9_2/test/win32ole/test_win32ole_typelib.rb =================================================================== --- ruby_1_9_2/test/win32ole/test_win32ole_typelib.rb (revision 30045) +++ ruby_1_9_2/test/win32ole/test_win32ole_typelib.rb (revision 30046) @@ -46,6 +46,12 @@ } end + # #Bug:3907 [ruby-dev:42338] + def test_initialize_with_REG_EXPAND_SZ + tlib = WIN32OLE_TYPELIB.new("Disk Management Snap-In Object Library") + assert_instance_of(WIN32OLE_TYPELIB, tlib) + end + def test_guid tlib = WIN32OLE_TYPELIB.new("Microsoft Shell Controls And Automation") assert_equal("{50A7E9B0-70EF-11D1-B75A-00A0C90564FE}", tlib.guid) -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/