Commit daec7207 authored by Jason Edmeades's avatar Jason Edmeades Committed by Alexandre Julliard

Ensure VarBstrCat handles null parms as per windows and actually does

the concatenation even for null args.
parent 0bb6fdda
......@@ -4916,18 +4916,22 @@ HRESULT WINAPI VarBstrCmp(BSTR left, BSTR right, LCID lcid, DWORD flags)
HRESULT WINAPI VarBstrCat(BSTR left, BSTR right, BSTR *out)
{
BSTR result;
int size = 0;
TRACE("( %s %s %p )\n", debugstr_w(left), debugstr_w(right), out);
if( (!left) || (!right) || (!out) )
return 0;
result = SysAllocStringLen(left, lstrlenW(left)+lstrlenW(right));
lstrcatW(result,right);
/* On Windows, NULL parms are still handled (as empty strings) */
if (left) size=size + lstrlenW(left);
if (right) size=size + lstrlenW(right);
if (out) {
result = SysAllocStringLen(NULL, size);
*out = result;
return 1;
if (left) lstrcatW(result,left);
if (right) lstrcatW(result,right);
TRACE("result = %s, [%p]\n", debugstr_w(result), result);
}
return S_OK;
}
/**********************************************************************
......@@ -5529,5 +5533,3 @@ HRESULT WINAPI VarFormat(LPVARIANT varIn, LPOLESTR format,
TRACE("result: '%s'\n", debugstr_w(*pbstrOut));
return rc;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment