代码拉取完成,页面将自动刷新
同步操作将从 OpenHarmony/third_party_libxml2 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
From 38f04779f7afd758db6210123ec0b64c489595c5 Mon Sep 17 00:00:00 2001
From: Nick Wellnhofer <wellnhofer@aevum.de>
Date: Mon, 22 Aug 2022 13:33:35 +0200
Subject: [PATCH] Fix HTML parser with threads and --without-legacy
If the legacy functions are disabled, the default "V1" HTML SAX handler
isn't initialized in threads other than the main thread.
htmlInitParserCtxt would later use the empty V1 SAX handler, resulting
in NULL documents.
Change htmlInitParserCtxt to initialize the HTML SAX handler by calling
xmlSAX2InitHtmlDefaultSAXHandler. This removes the ability to change the
default handler but is more in line with the XML parser which
initializes the SAX handler by calling xmlSAXVersion, ignoring the V1
default handler.
Fixes #399.
Reference:https://github.com/GNOME/libxml2/commit/38f04779f7afd758db6210123ec0b64c489595c5
Conflict:NA
---
HTMLparser.c | 11 ++++-------
1 file changed, 4 insertions(+), 7 deletions(-)
diff --git a/HTMLparser.c b/HTMLparser.c
index e95d86b..98d73f3 100644
--- a/HTMLparser.c
+++ b/HTMLparser.c
@@ -5039,8 +5039,7 @@ htmlInitParserCtxt(htmlParserCtxtPtr ctxt)
htmlErrMemory(NULL, "htmlInitParserCtxt: out of memory\n");
return(-1);
}
- else
- memset(sax, 0, sizeof(htmlSAXHandler));
+ memset(sax, 0, sizeof(htmlSAXHandler));
/* Allocate the Input stack */
ctxt->inputTab = (htmlParserInputPtr *)
@@ -5099,11 +5098,9 @@ htmlInitParserCtxt(htmlParserCtxtPtr ctxt)
ctxt->nodeInfoNr = 0;
ctxt->nodeInfoMax = 0;
- if (sax == NULL) ctxt->sax = (xmlSAXHandlerPtr) &htmlDefaultSAXHandler;
- else {
- ctxt->sax = sax;
- memcpy(sax, &htmlDefaultSAXHandler, sizeof(xmlSAXHandlerV1));
- }
+ ctxt->sax = sax;
+ xmlSAX2InitHtmlDefaultSAXHandler(sax);
+
ctxt->userData = ctxt;
ctxt->myDoc = NULL;
ctxt->wellFormed = 1;
--
2.27.0
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。