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
63c489fa
Commit
63c489fa
authored
Mar 08, 2017
by
Nikolay Sivov
Committed by
Alexandre Julliard
Mar 08, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
xmllite/reader: Fix GetValue() for comments.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
2d3ec124
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
4 deletions
+33
-4
reader.c
dlls/xmllite/reader.c
+1
-1
reader.c
dlls/xmllite/tests/reader.c
+32
-3
No files found.
dlls/xmllite/reader.c
View file @
63c489fa
...
...
@@ -3060,7 +3060,7 @@ static HRESULT WINAPI xmlreader_GetValue(IXmlReader* iface, const WCHAR **value,
*
value
=
NULL
;
if
((
reader
->
nodetype
==
XmlNodeType_Comment
&&
!
val
->
str
)
||
is_reader_pending
(
reader
))
if
((
reader
->
nodetype
==
XmlNodeType_Comment
&&
!
val
->
str
&&
!
val
->
len
)
||
is_reader_pending
(
reader
))
{
XmlNodeType
type
;
HRESULT
hr
;
...
...
dlls/xmllite/tests/reader.c
View file @
63c489fa
...
...
@@ -954,18 +954,47 @@ static struct test_entry comment_tests[] = {
static
void
test_read_comment
(
void
)
{
static
const
char
*
teststr
=
"<a>text<!-- comment --></a>"
;
struct
test_entry
*
test
=
comment_tests
;
static
const
XmlNodeType
types
[]
=
{
XmlNodeType_Element
,
XmlNodeType_Text
,
XmlNodeType_Comment
,
XmlNodeType_EndElement
,
};
unsigned
int
i
=
0
;
IXmlReader
*
reader
;
XmlNodeType
type
;
IStream
*
stream
;
HRESULT
hr
;
hr
=
CreateXmlReader
(
&
IID_IXmlReader
,
(
void
**
)
&
reader
,
NULL
);
ok
(
hr
==
S_OK
,
"S_OK, got %08x
\n
"
,
hr
);
while
(
test
->
xml
)
stream
=
create_stream_on_data
(
teststr
,
strlen
(
teststr
));
hr
=
IXmlReader_SetInput
(
reader
,
(
IUnknown
*
)
stream
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
while
(
IXmlReader_Read
(
reader
,
&
type
)
==
S_OK
)
{
XmlNodeType
type
;
IStream
*
stream
;
const
WCHAR
*
value
;
ok
(
type
==
types
[
i
],
"%d: unexpected node type %d
\n
"
,
i
,
type
);
if
(
type
==
XmlNodeType_Text
||
type
==
XmlNodeType_Comment
)
{
hr
=
IXmlReader_GetValue
(
reader
,
&
value
,
NULL
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
ok
(
*
value
!=
0
,
"Expected node value
\n
"
);
}
i
++
;
}
IStream_Release
(
stream
);
while
(
test
->
xml
)
{
stream
=
create_stream_on_data
(
test
->
xml
,
strlen
(
test
->
xml
)
+
1
);
hr
=
IXmlReader_SetInput
(
reader
,
(
IUnknown
*
)
stream
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
...
...
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