Merge pull request #274 from CMB/cmbcdata

Issue #65, fix for ignoring cdata.
This commit is contained in:
Geoff McLane 2015-09-25 12:57:28 +02:00
commit ce2481c3a9
1 changed files with 4 additions and 13 deletions

View File

@ -1990,21 +1990,12 @@ static Bool IsInQuotesorComment( Lexer * lexer )
/* Ignore **EVERYTHING** until "]]>" */
i++;
off = 0;
for ( ; i < lexer->lexsize; i++ )
for ( ; i <= lexer->lexsize - 3; i++ )
{
pnc = &lexer->lexbuf[i];
c = *pnc;
if ( c == ']' ) {
buff[off++] = c;
} else if (off && ((off + 1) < MX_TAG_BUFF)) {
buff[off++] = c;
if ( c == '>' ) {
buff[off] = 0;
if (TY_(tmbstrcmp)(buff,"]]>") == 0) {
break;
}
off = 0;
}
if (*pnc == ']' && *(pnc + 1) == ']' && *(pnc + 2) == '>')
{
break;
}
}
}