Commit 1e108423 authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

ntdll: Fix manifest attribute parsing.

parent b6ba53e5
......@@ -74,6 +74,11 @@ static const char manifest1[] =
"<assemblyIdentity version=\"1.0.0.0\" name=\"Wine.Test\" type=\"win32\"></assemblyIdentity>"
"</assembly>";
static const char manifest1_1[] =
"<assembly xmlns = \"urn:schemas-microsoft-com:asm.v1\" manifestVersion = \"1.0\">"
"<assemblyIdentity version = \"1.0.0.0\" name = \"Wine.Test\" type = \"win32\"></assemblyIdentity>"
"</assembly>";
static const char manifest2[] =
"<assembly xmlns=\"urn:schemas-microsoft-com:asm.v1\" manifestVersion=\"1.0\">"
"<assemblyIdentity version=\"1.2.3.4\" name=\"Wine.Test\" type=\"win32\">"
......@@ -1748,6 +1753,13 @@ static void test_actctx(void)
pReleaseActCtx(handle);
}
/* test for whitespace handling in Eq ::= S? '=' S? */
create_manifest_file("test1_1.manifest", manifest1_1, -1, NULL, NULL);
handle = test_create("test1_1.manifest");
ok(handle != INVALID_HANDLE_VALUE, "got %p\n", handle);
DeleteFileA("test1_1.manifest");
pReleaseActCtx(handle);
if(!create_manifest_file("test1.manifest", manifest1, -1, NULL, NULL)) {
skip("Could not create manifest file\n");
return;
......
......@@ -1125,13 +1125,23 @@ static BOOL next_xml_attr(xmlbuf_t* xmlbuf, xmlstr_t* name, xmlstr_t* value,
ptr = xmlbuf->ptr;
while (ptr < xmlbuf->end && *ptr != '=' && *ptr != '>' && !isxmlspace(*ptr)) ptr++;
if (ptr == xmlbuf->end || *ptr != '=') return FALSE;
if (ptr == xmlbuf->end) return FALSE;
name->ptr = xmlbuf->ptr;
name->len = ptr-xmlbuf->ptr;
xmlbuf->ptr = ptr;
/* skip spaces before '=' */
while (ptr < xmlbuf->end && *ptr != '=' && isxmlspace(*ptr)) ptr++;
if (ptr == xmlbuf->end || *ptr != '=') return FALSE;
/* skip '=' itself */
ptr++;
if (ptr == xmlbuf->end) return FALSE;
/* skip spaces after '=' */
while (ptr < xmlbuf->end && *ptr != '"' && *ptr != '\'' && isxmlspace(*ptr)) ptr++;
if (ptr == xmlbuf->end || (*ptr != '"' && *ptr != '\'')) return FALSE;
value->ptr = ++ptr;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment