msxml3: Return NULL instead of empty string in IXMLElement::get_tagName.

This commit is contained in:
Jacek Caban 2013-11-16 16:06:51 +01:00 committed by Alexandre Julliard
parent f3a2cb7bbd
commit fe0f945769
2 changed files with 7 additions and 3 deletions

View File

@ -893,7 +893,7 @@ static void test_xmlelem(void)
hr = IXMLElement_get_tagName(element, &str); hr = IXMLElement_get_tagName(element, &str);
EXPECT_HR(hr, S_OK); EXPECT_HR(hr, S_OK);
ok(lstrlenW(str) == 0, "Expected empty tag name\n"); ok(!str, "Expected empty tag name, got %s\n", wine_dbgstr_w(str));
SysFreeString(str); SysFreeString(str);
parent = (IXMLElement *)0xdeadbeef; parent = (IXMLElement *)0xdeadbeef;

View File

@ -189,8 +189,12 @@ static HRESULT WINAPI xmlelem_get_tagName(IXMLElement *iface, BSTR *p)
if (!p) if (!p)
return E_INVALIDARG; return E_INVALIDARG;
if (*This->node->name) {
*p = bstr_from_xmlChar(This->node->name); *p = bstr_from_xmlChar(This->node->name);
CharUpperBuffW(*p, SysStringLen(*p)); CharUpperBuffW(*p, SysStringLen(*p));
}else {
*p = NULL;
}
TRACE("returning %s\n", debugstr_w(*p)); TRACE("returning %s\n", debugstr_w(*p));