Project

General

Profile

Bug #11880 » blankstr.patch

長さ0のBSTRはCOMの規約に従いNULLとするパッチ - arton (Akio Tajima), 12/26/2015 02:57 PM

View differences:

win32ole.c Sat Dec 26 23:52:40 2015
/* 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);
......
case VT_BSTR:
{
if(V_ISBYREF(pvar))
obj = ole_wc2vstr(*V_BSTRREF(pvar), FALSE);
{
obj = (SysStringLen(*V_BSTRREF(pvar)) == 0)
? rb_str_new2("")
: ole_wc2vstr(*V_BSTRREF(pvar), FALSE);
}
else
obj = ole_wc2vstr(V_BSTR(pvar), FALSE);
{
obj = (SysStringLen(V_BSTR(pvar)) == 0)
? rb_str_new2("")
: ole_wc2vstr(V_BSTR(pvar), FALSE);
}
break;
}
    (1-1/1)