aboutsummaryrefslogtreecommitdiffstats
path: root/SAX2.c
diff options
context:
space:
mode:
authorPavel Andrejs <pavel.andrejs@gmail.com>2012-05-08 11:01:12 +0800
committerDaniel Veillard <veillard@redhat.com>2012-05-08 11:01:12 +0800
commit8ad4da5f56d8f6cadb9e5ed4bb50ded3beec8f5a (patch)
tree5ebdfb32f1c298c9c8d7780206dc06ebfc12caae /SAX2.c
parent48f0f3f29f52244c9ea3437d2f3d407abd777a83 (diff)
downloadandroid_external_libxml2-8ad4da5f56d8f6cadb9e5ed4bb50ded3beec8f5a.tar.gz
android_external_libxml2-8ad4da5f56d8f6cadb9e5ed4bb50ded3beec8f5a.tar.bz2
android_external_libxml2-8ad4da5f56d8f6cadb9e5ed4bb50ded3beec8f5a.zip
HTML element position is not detected propperly
The data in node_seq in xmlParserCtxt was not updated properly when parsing HTML. This patch fixes the accounting for both pull and push mode of HTML parsing.
Diffstat (limited to 'SAX2.c')
-rw-r--r--SAX2.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/SAX2.c b/SAX2.c
index e230ceaa..453f4c8f 100644
--- a/SAX2.c
+++ b/SAX2.c
@@ -1756,7 +1756,6 @@ void
xmlSAX2EndElement(void *ctx, const xmlChar *name ATTRIBUTE_UNUSED)
{
xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
- xmlParserNodeInfo node_info;
xmlNodePtr cur;
if (ctx == NULL) return;
@@ -1770,10 +1769,10 @@ xmlSAX2EndElement(void *ctx, const xmlChar *name ATTRIBUTE_UNUSED)
/* Capture end position and add node */
if (cur != NULL && ctxt->record_info) {
- node_info.end_pos = ctxt->input->cur - ctxt->input->base;
- node_info.end_line = ctxt->input->line;
- node_info.node = cur;
- xmlParserAddNodeInfo(ctxt, &node_info);
+ ctxt->nodeInfo->end_pos = ctxt->input->cur - ctxt->input->base;
+ ctxt->nodeInfo->end_line = ctxt->input->line;
+ ctxt->nodeInfo->node = cur;
+ xmlParserAddNodeInfo(ctxt, ctxt->nodeInfo);
}
ctxt->nodemem = -1;