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
2bdaffd8
Commit
2bdaffd8
authored
Mar 24, 2013
by
Nikolay Sivov
Committed by
Alexandre Julliard
Mar 26, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
xmllite: Partially implement value normalization for CDATA sections.
parent
448e939e
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
1 deletion
+22
-1
reader.c
dlls/xmllite/reader.c
+6
-0
reader.c
dlls/xmllite/tests/reader.c
+16
-1
No files found.
dlls/xmllite/reader.c
View file @
2bdaffd8
...
...
@@ -1835,6 +1835,12 @@ static HRESULT reader_parse_cdata(xmlreader *reader)
}
else
{
/* Value normalization is not fully implemented, rules are:
- single '\r' -> '\n';
- sequence '\r\n' -> '\n', in this case value length changes;
*/
if
(
*
ptr
==
'\r'
)
*
ptr
=
'\n'
;
reader_skipn
(
reader
,
1
);
ptr
++
;
}
...
...
dlls/xmllite/tests/reader.c
View file @
2bdaffd8
...
...
@@ -771,6 +771,7 @@ struct test_entry {
const
char
*
value
;
HRESULT
hr
;
HRESULT
hr_broken
;
/* this is set to older version results */
int
todo
:
1
;
};
static
struct
test_entry
comment_tests
[]
=
{
...
...
@@ -1317,6 +1318,9 @@ static void test_readvaluechunk(void)
static
struct
test_entry
cdata_tests
[]
=
{
{
"<a><![CDATA[ ]]data ]]></a>"
,
""
,
" ]]data "
,
S_OK
},
{
"<a><![CDATA[<![CDATA[ data ]]]]></a>"
,
""
,
"<![CDATA[ data ]]"
,
S_OK
},
{
"<a><![CDATA[
\n
\r\n
\n\n
]]></a>"
,
""
,
"
\n
\n
\n\n
"
,
S_OK
,
S_OK
,
1
},
{
"<a><![CDATA[
\r
\r\r\n
\n\n
]]></a>"
,
""
,
"
\n
\n\n
\n\n
"
,
S_OK
,
S_OK
,
1
},
{
"<a><![CDATA[
\r\r
\n\r
\r
\n\n
]]></a>"
,
""
,
"
\n\n
\n\n
\n
\n\n
"
,
S_OK
},
{
NULL
}
};
...
...
@@ -1383,9 +1387,20 @@ static void test_read_cdata(void)
str
=
NULL
;
hr
=
IXmlReader_GetValue
(
reader
,
&
str
,
&
len
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
len
==
strlen
(
test
->
value
),
"got %u
\n
"
,
len
);
str_exp
=
a2w
(
test
->
value
);
if
(
test
->
todo
)
{
todo_wine
{
ok
(
len
==
strlen
(
test
->
value
),
"got %u
\n
"
,
len
);
ok
(
!
lstrcmpW
(
str
,
str_exp
),
"got %s
\n
"
,
wine_dbgstr_w
(
str
));
}
}
else
{
ok
(
len
==
strlen
(
test
->
value
),
"got %u
\n
"
,
len
);
ok
(
!
lstrcmpW
(
str
,
str_exp
),
"got %s
\n
"
,
wine_dbgstr_w
(
str
));
}
free_str
(
str_exp
);
}
...
...
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