Module: wine Branch: master Commit: 48f038fb9eb916e4ac2dd13c2d05cde1860a3215 URL: https://source.winehq.org/git/wine.git/?a=commit;h=48f038fb9eb916e4ac2dd13c2...
Author: Daniel Lehman dlehman25@gmail.com Date: Fri Oct 22 16:41:27 2021 +0300
msxml3: Handle single quotes in xml declaration.
Signed-off-by: Daniel Lehman dlehman25@gmail.com Signed-off-by: Nikolay Sivov nsivov@codeweavers.com Signed-off-by: Alexandre Julliard julliard@winehq.org
---
dlls/msxml3/pi.c | 7 ++++--- dlls/msxml3/tests/domdoc.c | 6 +----- 2 files changed, 5 insertions(+), 8 deletions(-)
diff --git a/dlls/msxml3/pi.c b/dlls/msxml3/pi.c index fb4ca798c68..80e6ad70755 100644 --- a/dlls/msxml3/pi.c +++ b/dlls/msxml3/pi.c @@ -284,7 +284,7 @@ static HRESULT WINAPI dom_pi_get_nextSibling(
static HRESULT xml_get_value(xmlChar **p, xmlChar **value) { - xmlChar *v; + xmlChar *v, q; int len;
while (isspace(**p)) *p += 1; @@ -292,11 +292,12 @@ static HRESULT xml_get_value(xmlChar **p, xmlChar **value) *p += 1;
while (isspace(**p)) *p += 1; - if (**p != '"') return XML_E_MISSINGQUOTE; + if (**p != '"' && **p != ''') return XML_E_MISSINGQUOTE; + q = **p; *p += 1;
v = *p; - while (**p && **p != '"') *p += 1; + while (**p && **p != q) *p += 1; if (!**p) return XML_E_EXPECTINGCLOSEQUOTE; len = *p - v; if (!len) return XML_E_MISSINGNAME; diff --git a/dlls/msxml3/tests/domdoc.c b/dlls/msxml3/tests/domdoc.c index 81ee8dcb52d..e1f71bf5445 100644 --- a/dlls/msxml3/tests/domdoc.c +++ b/dlls/msxml3/tests/domdoc.c @@ -8608,19 +8608,15 @@ todo_wine ok(hr == XML_E_BADCHARINSTRING, "got 0x%08x\n", hr); pi = NULL; hr = IXMLDOMDocument_createProcessingInstruction(doc, _bstr_("xml"), _bstr_("version="1.0" encoding='UTF-8'"), &pi); -todo_wine ok(hr == S_OK, "got 0x%08x\n", hr); -if (pi) -{ hr = IXMLDOMProcessingInstruction_QueryInterface(pi, &IID_IXMLDOMNode, (void **)&node); node_map = NULL; ok(hr == S_OK, "got 0x%08x\n", hr); hr = IXMLDOMNode_get_attributes(node, &node_map); ok(hr == S_OK, "got 0x%08x\n", hr); - if (node_map) IXMLDOMNamedNodeMap_Release(node_map); + IXMLDOMNamedNodeMap_Release(node_map); IXMLDOMNode_Release(node); IXMLDOMProcessingInstruction_Release(pi); -}
/* test for BSTR handling, pass broken BSTR */ memcpy(&buff[2], L"test", 5 * sizeof(WCHAR));