[PATCH 3/5] msxml3: Handle single quotes in xml declaration.

Daniel Lehman dlehman25 at gmail.com
Wed Sep 29 00:16:47 CDT 2021


Signed-off-by: Daniel Lehman <dlehman25 at gmail.com>
---
 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 d0626c7b0dd..95e6cf34e1c 100644
--- a/dlls/msxml3/pi.c
+++ b/dlls/msxml3/pi.c
@@ -290,7 +290,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;
@@ -298,11 +298,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));
-- 
2.25.1




More information about the wine-devel mailing list