1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* ext/win32ole/win32ole.c (ole_variant2val): refactoring.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53350 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
suke 2015-12-27 14:34:11 +00:00
parent 1187cf0e00
commit db8dcd1b27
2 changed files with 12 additions and 10 deletions

View file

@ -1,3 +1,7 @@
Sun Dec 27 23:32:26 2015 Masaki Suketa <masaki.suketa@nifty.ne.jp>
* ext/win32ole/win32ole.c (ole_variant2val): refactoring.
Sun Dec 27 21:14:42 2015 NAKAMURA Usaku <usa@ruby-lang.org>
* process.c (rb_execarg_parent_start1): need to convert the encoding to

View file

@ -1574,16 +1574,14 @@ ole_variant2val(VARIANT *pvar)
case VT_BSTR:
{
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);
}
BSTR bstr;
if(V_ISBYREF(pvar))
bstr = *V_BSTRREF(pvar);
else
bstr = V_BSTR(pvar);
obj = (SysStringLen(bstr) == 0)
? rb_str_new2("")
: ole_wc2vstr(bstr, FALSE);
break;
}