1 Star 0 Fork 48

冉召宇/third_party_libxml2_1

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
backport-Properly-fold-whitespace-around-the-QName-value-when.patch 1.26 KB
一键复制 编辑 原始数据 按行查看 历史
冉召宇 提交于 2024-04-25 19:13 . libxml2切openEuler7.0
From 2fe372a0aa2cdeb5cf518cf430defba36647c502 Mon Sep 17 00:00:00 2001
From: Damjan Jovanovic <damjan.jov@gmail.com>
Date: Sat, 21 Aug 2021 07:21:50 +0200
Subject: [PATCH] Properly fold whitespace around the QName value when
validating an XSD schema.
(May also need fixing in other places.)
Issue: 239
Conflict:NA
Reference:https://gitlab.gnome.org/GNOME/libxml2/-/commit/2fe372a0aa2cdeb5cf518cf430defba36647c502
---
xmlschemas.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/xmlschemas.c b/xmlschemas.c
index 2da962b..9da4cd1 100644
--- a/xmlschemas.c
+++ b/xmlschemas.c
@@ -24645,6 +24645,7 @@ xmlSchemaValidateQName(xmlSchemaValidCtxtPtr vctxt,
int valNeeded)
{
int ret;
+ xmlChar *stripped;
const xmlChar *nsName;
xmlChar *local, *prefix = NULL;
@@ -24661,7 +24662,10 @@ xmlSchemaValidateQName(xmlSchemaValidCtxtPtr vctxt,
* NOTE: xmlSplitQName2 will always return a duplicated
* strings.
*/
- local = xmlSplitQName2(value, &prefix);
+ /* TODO: Export and use xmlSchemaStrip instead */
+ stripped = xmlSchemaCollapseString(value);
+ local = xmlSplitQName2(stripped ? stripped : value, &prefix);
+ xmlFree(stripped);
if (local == NULL)
local = xmlStrdup(value);
/*
--
2.27.0
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/ran-zhao-yu/third_party_libxml2_1.git
git@gitee.com:ran-zhao-yu/third_party_libxml2_1.git
ran-zhao-yu
third_party_libxml2_1
third_party_libxml2_1
master

搜索帮助