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

ruby-changes:42849

From: nagachika <ko1@a...>
Date: Fri, 6 May 2016 01:32:10 +0900 (JST)
Subject: [ruby-changes:42849] nagachika:r54923 (ruby_2_3): merge revision(s) 53322, 53323: [Backport #11880]

nagachika	2016-05-06 02:28:45 +0900 (Fri, 06 May 2016)

  New Revision: 54923

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

  Log:
    merge revision(s) 53322,53323: [Backport #11880]
    
    * ext/win32ole/win32ole.c (ole_vstr2wc, ole_variant2val): fix blank
      string conversion. 
      [Bug #11880]
      Thanks Akio Tajima for the patch!
      string conversion.

  Modified directories:
    branches/ruby_2_3/
  Modified files:
    branches/ruby_2_3/ChangeLog
    branches/ruby_2_3/ext/win32ole/win32ole.c
    branches/ruby_2_3/version.h
Index: ruby_2_3/ChangeLog
===================================================================
--- ruby_2_3/ChangeLog	(revision 54922)
+++ ruby_2_3/ChangeLog	(revision 54923)
@@ -1,3 +1,10 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_3/ChangeLog#L1
+Fri May  6 02:28:31 2016  Masaki Suketa <masaki.suketa@n...>
+
+	* ext/win32ole/win32ole.c (ole_vstr2wc, ole_variant2val): fix blank
+	  string conversion.
+	  [Bug #11880]
+	  Thanks Akio Tajima for the patch!
+
 Fri May  6 02:24:13 2016  Kazuhiro NISHIYAMA  <zn@m...>
 
 	* bignum.c: [DOC] Update result of 123456789 ** -2.
Index: ruby_2_3/ext/win32ole/win32ole.c
===================================================================
--- ruby_2_3/ext/win32ole/win32ole.c	(revision 54922)
+++ ruby_2_3/ext/win32ole/win32ole.c	(revision 54923)
@@ -864,6 +864,9 @@ ole_vstr2wc(VALUE vstr) https://github.com/ruby/ruby/blob/trunk/ruby_2_3/ext/win32ole/win32ole.c#L864
     /* do not type-conversion here to prevent from other arguments
      * changing (if exist) */
     Check_Type(vstr, T_STRING);
+    if (RSTRING_LEN(vstr) == 0) {
+        return NULL;
+    }
 
     enc = rb_enc_get(vstr);
 
@@ -1571,10 +1574,16 @@ ole_variant2val(VARIANT *pvar) https://github.com/ruby/ruby/blob/trunk/ruby_2_3/ext/win32ole/win32ole.c#L1574
 
     case VT_BSTR:
     {
-        if(V_ISBYREF(pvar))
-            obj = ole_wc2vstr(*V_BSTRREF(pvar), FALSE);
-        else
-            obj = ole_wc2vstr(V_BSTR(pvar), FALSE);
+        if(V_ISBYREF(pvar)) {
+            obj = (SysStringLen(*V_BSTRREF(pvar)) == 0)
+                ? rb_str_new2("")
+                : ole_wc2vstr(*V_BSTRREF(pvar), FALSE);
+        }
+        else {
+            obj = (SysStringLen(V_BSTR(pvar)) == 0)
+                ? rb_str_new2("")
+                : ole_wc2vstr(V_BSTR(pvar), FALSE);
+        }
         break;
     }
 
Index: ruby_2_3/version.h
===================================================================
--- ruby_2_3/version.h	(revision 54922)
+++ ruby_2_3/version.h	(revision 54923)
@@ -1,6 +1,6 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_3/version.h#L1
 #define RUBY_VERSION "2.3.2"
 #define RUBY_RELEASE_DATE "2016-05-06"
-#define RUBY_PATCHLEVEL 116
+#define RUBY_PATCHLEVEL 117
 
 #define RUBY_RELEASE_YEAR 2016
 #define RUBY_RELEASE_MONTH 5

Property changes on: ruby_2_3
___________________________________________________________________
Modified: svn:mergeinfo
   Merged /trunk:r53322-53323


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

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