eina/simple_xml_parser: don't parse the <, > in the attribute string.

The tag identifier should not be inside of the string "~".
Previous logic doesn't care that scenario,
the parser context can be corrupted and it will be no more useful.

@fix
This commit is contained in:
ChunEon Park 2015-06-18 19:51:06 +09:00
parent ca0e51a2c6
commit d72aa3fecb
1 changed files with 9 additions and 2 deletions

View File

@ -136,9 +136,16 @@ _eina_simple_xml_tag_start_find(const char *itr, const char *itr_end)
static inline const char *
_eina_simple_xml_tag_end_find(const char *itr, const char *itr_end)
{
Eina_Bool inside_quote = EINA_FALSE;
for (; itr < itr_end; itr++)
if ((*itr == '>') || (*itr == '<')) /* consider < also ends a tag */
return itr;
{
if (*itr == '"') inside_quote = !inside_quote;
if (!inside_quote)
{
if ((*itr == '>') || (*itr == '<')) /* consider < also ends a tag */
return itr;
}
}
return NULL;
}