Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
1ccc1f2f
Commit
1ccc1f2f
authored
Mar 10, 2017
by
Nikolay Sivov
Committed by
Alexandre Julliard
Mar 10, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
xmllite/reader: Return static empty string as xml declaration node value.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
be0e0560
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
37 additions
and
30 deletions
+37
-30
reader.c
dlls/xmllite/reader.c
+37
-30
No files found.
dlls/xmllite/reader.c
View file @
1ccc1f2f
...
...
@@ -1328,7 +1328,6 @@ static HRESULT reader_parse_xmldecl(xmlreader *reader)
reader
->
empty_element
.
position
=
position
;
reader_set_strvalue
(
reader
,
StringValue_LocalName
,
&
strval_xml
);
reader_set_strvalue
(
reader
,
StringValue_QualifiedName
,
&
strval_xml
);
reader_set_strvalue
(
reader
,
StringValue_Value
,
&
strval_empty
);
return
S_OK
;
}
...
...
@@ -3171,26 +3170,17 @@ static HRESULT WINAPI xmlreader_GetPrefix(IXmlReader* iface, const WCHAR **ret,
return
S_OK
;
}
static
BOOL
is_namespace_definition
(
xmlreader
*
reader
)
{
const
strval
*
local
=
&
reader
->
strvalues
[
StringValue_LocalName
];
const
strval
*
prefix
=
&
reader
->
strvalues
[
StringValue_Prefix
];
if
(
reader_get_nodetype
(
reader
)
!=
XmlNodeType_Attribute
)
return
FALSE
;
return
((
strval_eq
(
reader
,
prefix
,
&
strval_empty
)
&&
strval_eq
(
reader
,
local
,
&
strval_xmlns
))
||
strval_eq
(
reader
,
prefix
,
&
strval_xmlns
));
}
static
HRESULT
WINAPI
xmlreader_GetValue
(
IXmlReader
*
iface
,
const
WCHAR
**
value
,
UINT
*
len
)
{
xmlreader
*
reader
=
impl_from_IXmlReader
(
iface
);
strval
*
val
=
&
reader
->
strvalues
[
StringValue_Value
];
UINT
length
;
TRACE
(
"(%p)->(%p %p)
\n
"
,
reader
,
value
,
len
);
*
value
=
NULL
;
if
(
!
len
)
len
=
&
length
;
if
((
reader
->
nodetype
==
XmlNodeType_Comment
&&
!
val
->
str
&&
!
val
->
len
)
||
is_reader_pending
(
reader
))
{
...
...
@@ -3204,29 +3194,46 @@ static HRESULT WINAPI xmlreader_GetValue(IXmlReader* iface, const WCHAR **value,
if
(
is_reader_pending
(
reader
))
return
E_PENDING
;
}
if
(
!
val
->
str
)
switch
(
reader_get_nodetype
(
reader
)
)
{
WCHAR
*
ptr
=
reader_alloc
(
reader
,
(
val
->
len
+
1
)
*
sizeof
(
WCHAR
));
if
(
!
ptr
)
return
E_OUTOFMEMORY
;
memcpy
(
ptr
,
reader_get_strptr
(
reader
,
val
),
val
->
len
*
sizeof
(
WCHAR
));
ptr
[
val
->
len
]
=
0
;
val
->
str
=
ptr
;
}
case
XmlNodeType_XmlDeclaration
:
*
value
=
emptyW
;
*
len
=
0
;
break
;
case
XmlNodeType_Attribute
:
{
const
strval
*
local
=
&
reader
->
strvalues
[
StringValue_LocalName
];
const
strval
*
prefix
=
&
reader
->
strvalues
[
StringValue_Prefix
];
/* For namespace definition attributes return values from namespace list */
if
(
is_namespace_definition
(
reader
))
{
const
strval
*
local
=
&
reader
->
strvalues
[
StringValue_LocalName
];
struct
ns
*
ns
;
/* For namespace definition attributes return values from namespace list */
if
(((
strval_eq
(
reader
,
prefix
,
&
strval_empty
)
&&
strval_eq
(
reader
,
local
,
&
strval_xmlns
))
||
strval_eq
(
reader
,
prefix
,
&
strval_xmlns
)))
{
struct
ns
*
ns
;
ns
=
reader_lookup_ns
(
reader
,
local
);
if
(
!
ns
)
ns
=
reader_lookup_nsdef
(
reader
);
if
(
!
(
ns
=
reader_lookup_ns
(
reader
,
local
)))
ns
=
reader_lookup_nsdef
(
reader
);
val
=
&
ns
->
uri
;
*
value
=
ns
->
uri
.
str
;
*
len
=
ns
->
uri
.
len
;
break
;
}
}
/* fallthrough */
default:
if
(
!
val
->
str
)
{
WCHAR
*
ptr
=
reader_alloc
(
reader
,
(
val
->
len
+
1
)
*
sizeof
(
WCHAR
));
if
(
!
ptr
)
return
E_OUTOFMEMORY
;
memcpy
(
ptr
,
reader_get_strptr
(
reader
,
val
),
val
->
len
*
sizeof
(
WCHAR
));
ptr
[
val
->
len
]
=
0
;
val
->
str
=
ptr
;
}
*
value
=
val
->
str
;
*
len
=
val
->
len
;
break
;
}
*
value
=
val
->
str
;
if
(
len
)
*
len
=
val
->
len
;
return
S_OK
;
}
...
...
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