Issue #597 - Avoid reporting root node in lexer.c

This commit is contained in:
Geoff McLane 2017-09-17 16:29:47 +02:00
parent 5d017fe532
commit a14cffc598

View file

@ -1551,7 +1551,15 @@ void TY_(RemoveAttribute)( TidyDocImpl* doc, Node *node, AttVal *attr )
void TY_(FreeNode)( TidyDocImpl* doc, Node *node ) void TY_(FreeNode)( TidyDocImpl* doc, Node *node )
{ {
#if !defined(NDEBUG) && defined(_MSC_VER) && defined(DEBUG_ALLOCATION) #if !defined(NDEBUG) && defined(_MSC_VER) && defined(DEBUG_ALLOCATION)
if (node) SPRTF("Free node %p\n", node ); /* avoid showing free of root node! */
if (node) {
if (RootNode != node->type) {
SPRTF("Free node %p\n", node);
}
else {
SPRTF("Root node %p\n", node);
}
}
#endif #endif
/* this is no good ;=(( /* this is no good ;=((
if (node && doc && doc->lexer) { if (node && doc && doc->lexer) {