Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
6d5eef9c
Commit
6d5eef9c
authored
Mar 27, 2020
by
Hans Leidekker
Committed by
Alexandre Julliard
Mar 27, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
webservices: Accept empty namespace in attribute type mapping.
Signed-off-by:
Hans Leidekker
<
hans@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
9d530346
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
46 additions
and
4 deletions
+46
-4
reader.c
dlls/webservices/reader.c
+18
-3
reader.c
dlls/webservices/tests/reader.c
+28
-1
No files found.
dlls/webservices/reader.c
View file @
6d5eef9c
...
...
@@ -4343,9 +4343,24 @@ static HRESULT get_text( struct reader *reader, WS_TYPE_MAPPING mapping, const W
{
case
WS_ATTRIBUTE_TYPE_MAPPING
:
{
ULONG
index
;
if
(
!
(
*
found
=
find_attribute
(
reader
,
localname
,
ns
,
&
index
)))
return
S_OK
;
return
get_attribute_text
(
reader
,
index
,
ret
);
ULONG
i
;
WS_XML_ELEMENT_NODE
*
elem
=
&
reader
->
current
->
hdr
;
*
found
=
FALSE
;
for
(
i
=
0
;
i
<
elem
->
attributeCount
;
i
++
)
{
const
WS_XML_STRING
*
localname2
=
elem
->
attributes
[
i
]
->
localName
;
const
WS_XML_STRING
*
ns2
=
elem
->
attributes
[
i
]
->
ns
;
if
(
cmp_name
(
localname
->
bytes
,
localname
->
length
,
localname2
->
bytes
,
localname2
->
length
))
continue
;
if
(
!
ns
->
length
||
!
cmp_name
(
ns
->
bytes
,
ns
->
length
,
ns2
->
bytes
,
ns2
->
length
))
{
*
found
=
TRUE
;
break
;
}
}
if
(
!*
found
)
return
S_OK
;
return
get_attribute_text
(
reader
,
i
,
ret
);
}
case
WS_ELEMENT_TYPE_MAPPING
:
case
WS_ELEMENT_CONTENT_TYPE_MAPPING
:
...
...
dlls/webservices/tests/reader.c
View file @
6d5eef9c
...
...
@@ -2556,7 +2556,8 @@ static void test_cdata(void)
static
void
test_WsFindAttribute
(
void
)
{
static
const
char
test
[]
=
"<t attr='value' attr2='value2'></t>"
;
WS_XML_STRING
ns
=
{
0
,
NULL
},
localname
=
{
4
,
(
BYTE
*
)
"attr"
};
static
const
char
test2
[]
=
"<p:t attr='value' p:attr2='value2' xmlns:p=
\"
ns
\"
></t>"
;
WS_XML_STRING
ns
=
{
0
,
NULL
},
ns2
=
{
2
,
(
BYTE
*
)
"ns"
},
localname
=
{
4
,
(
BYTE
*
)
"attr"
};
WS_XML_STRING
localname2
=
{
5
,
(
BYTE
*
)
"attr2"
},
localname3
=
{
5
,
(
BYTE
*
)
"attr3"
};
WS_XML_READER
*
reader
;
ULONG
index
;
...
...
@@ -2638,6 +2639,32 @@ static void test_WsFindAttribute(void)
ok
(
hr
==
S_FALSE
,
"got %08x
\n
"
,
hr
);
ok
(
index
==
~
0u
,
"got %u
\n
"
,
index
);
hr
=
set_input
(
reader
,
test2
,
sizeof
(
test2
)
-
1
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
hr
=
WsReadNode
(
reader
,
NULL
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
index
=
0xdeadbeef
;
hr
=
WsFindAttribute
(
reader
,
&
localname
,
&
ns
,
TRUE
,
&
index
,
NULL
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
ok
(
!
index
,
"got %u
\n
"
,
index
);
hr
=
WsFindAttribute
(
reader
,
&
localname2
,
&
ns2
,
TRUE
,
&
index
,
NULL
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
hr
=
WsFindAttribute
(
reader
,
&
localname2
,
&
ns
,
TRUE
,
&
index
,
NULL
);
ok
(
hr
==
WS_E_INVALID_FORMAT
,
"got %08x
\n
"
,
hr
);
hr
=
set_input
(
reader
,
test2
,
sizeof
(
test2
)
-
1
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
hr
=
WsReadNode
(
reader
,
NULL
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
hr
=
WsFindAttribute
(
reader
,
&
localname
,
&
ns2
,
TRUE
,
&
index
,
NULL
);
ok
(
hr
==
WS_E_INVALID_FORMAT
,
"got %08x
\n
"
,
hr
);
WsFreeReader
(
reader
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment