1
0
Fork 0

catch one more syntax error and remove a stale debug printf

This commit is contained in:
ehofman 2009-04-27 09:45:59 +00:00 committed by Tim Moore
parent c8d321f3b9
commit e0528fc2d4

View file

@ -1547,6 +1547,14 @@ __xmlNodeGet(const char *start, size_t *len, char **name, size_t *rlen, size_t *
{ {
if (!strncasecmp(new+1, element, elementlen)) if (!strncasecmp(new+1, element, elementlen))
{ {
if (*(new+elementlen+1) != '>')
{
*rlen = 0;
*name = new+1;
*len = XML_ELEMENT_NO_CLOSING_TAG;
return 0;
}
if (found == num) if (found == num)
{ {
if (start_tag) if (start_tag)
@ -1564,7 +1572,9 @@ __xmlNodeGet(const char *start, size_t *len, char **name, size_t *rlen, size_t *
} }
found++; found++;
} }
/* else proper closing tag not yet found, continue */ /* else proper closing tag not yet found, continue. */
/* TODO: could be a bad match to the opening tag though */
/* like: <test></teft> */
new = memchr(cur, '>', restlen); new = memchr(cur, '>', restlen);
if (!new) if (!new)
@ -1583,7 +1593,6 @@ __xmlNodeGet(const char *start, size_t *len, char **name, size_t *rlen, size_t *
*rlen = 0; *rlen = 0;
*name = cur; *name = cur;
*len = XML_ELEMENT_NO_CLOSING_TAG; *len = XML_ELEMENT_NO_CLOSING_TAG;
printf("4\n");
return 0; return 0;
} }
} }