Commit 15dec466 authored by Vitaly Lipatov's avatar Vitaly Lipatov

UniXML: fix empty property handle in getPropUtf8

parent 92a22c64
......@@ -211,7 +211,10 @@ string UniXML::getProp(const xmlNode* node, const string name)
string UniXML::getPropUtf8(const xmlNode* node, const string name)
{
return (const char*)::xmlGetProp((xmlNode*)node, (const xmlChar*)name.c_str());
const char * text = (const char*)::xmlGetProp((xmlNode*)node, (const xmlChar*)name.c_str());
if (text == NULL)
return "";
return text;
}
int UniXML::getIntProp(const xmlNode* node, const string name )
......@@ -320,11 +323,12 @@ xmlNode* UniXML::findNodeUtf8(xmlNode* node, const string searchnode, const stri
{
if (searchnode == (const char*)node->name)
{
/* name , . , ģ */
if( name.empty() )
return node;
if( name == getPropUtf8(node, "name") )
return node;
if( name.empty() )
return node;
}
xmlNode * nodeFound = findNodeUtf8(node->children, searchnode, name);
if ( nodeFound != NULL )
......
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