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
477b7649
Commit
477b7649
authored
Jan 20, 2016
by
Hans Leidekker
Committed by
Alexandre Julliard
Jan 20, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
webservices: Parse attribute names.
Signed-off-by:
Hans Leidekker
<
hans@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
adcdb4c2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
3 deletions
+28
-3
reader.c
dlls/webservices/reader.c
+28
-3
No files found.
dlls/webservices/reader.c
View file @
477b7649
...
...
@@ -822,6 +822,32 @@ HRESULT append_attribute( WS_XML_ELEMENT_NODE *elem, WS_XML_ATTRIBUTE *attr )
return
S_OK
;
}
static
HRESULT
parse_name
(
const
unsigned
char
*
str
,
unsigned
int
len
,
WS_XML_STRING
**
prefix
,
WS_XML_STRING
**
localname
)
{
const
unsigned
char
*
name_ptr
=
str
,
*
prefix_ptr
=
NULL
;
unsigned
int
i
,
name_len
=
len
,
prefix_len
=
0
;
for
(
i
=
0
;
i
<
len
;
i
++
)
{
if
(
str
[
i
]
==
':'
)
{
prefix_ptr
=
str
;
prefix_len
=
i
;
name_ptr
=
&
str
[
i
+
1
];
name_len
-=
i
+
1
;
break
;
}
}
if
(
!
(
*
prefix
=
alloc_xml_string
(
prefix_ptr
,
prefix_len
)))
return
E_OUTOFMEMORY
;
if
(
!
(
*
localname
=
alloc_xml_string
(
name_ptr
,
name_len
)))
{
heap_free
(
*
prefix
);
return
E_OUTOFMEMORY
;
}
return
S_OK
;
}
static
HRESULT
read_attribute
(
struct
reader
*
reader
,
WS_XML_ATTRIBUTE
**
ret
)
{
WS_XML_ATTRIBUTE
*
attr
;
...
...
@@ -842,10 +868,9 @@ static HRESULT read_attribute( struct reader *reader, WS_XML_ATTRIBUTE **ret )
}
if
(
!
len
)
goto
error
;
if
((
hr
=
parse_name
(
start
,
len
,
&
attr
->
prefix
,
&
attr
->
localName
))
!=
S_OK
)
goto
error
;
if
(
!
attr
->
prefix
->
length
)
attr
->
prefix
->
bytes
=
NULL
;
hr
=
E_OUTOFMEMORY
;
if
(
!
(
attr
->
localName
=
alloc_xml_string
(
start
,
len
)))
goto
error
;
if
(
!
(
attr
->
prefix
=
alloc_xml_string
(
NULL
,
0
)))
goto
error
;
attr
->
prefix
->
bytes
=
NULL
;
if
(
!
(
attr
->
ns
=
alloc_xml_string
(
NULL
,
0
)))
goto
error
;
attr
->
ns
->
bytes
=
NULL
;
...
...
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