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
63e0b485
Commit
63e0b485
authored
Oct 14, 2015
by
Hans Leidekker
Committed by
Alexandre Julliard
Oct 15, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
webservices: Accept single quote as attribute value delimiter.
Signed-off-by:
Hans Leidekker
<
hans@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
935e9eb8
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
5 deletions
+26
-5
reader.c
dlls/webservices/reader.c
+5
-3
reader.c
dlls/webservices/tests/reader.c
+21
-2
No files found.
dlls/webservices/reader.c
View file @
63e0b485
...
@@ -746,7 +746,7 @@ static HRESULT read_attribute( struct reader *reader, WS_XML_ATTRIBUTE **ret )
...
@@ -746,7 +746,7 @@ static HRESULT read_attribute( struct reader *reader, WS_XML_ATTRIBUTE **ret )
{
{
WS_XML_ATTRIBUTE
*
attr
;
WS_XML_ATTRIBUTE
*
attr
;
WS_XML_UTF8_TEXT
*
text
;
WS_XML_UTF8_TEXT
*
text
;
unsigned
int
len
=
0
,
ch
,
skip
;
unsigned
int
len
=
0
,
ch
,
skip
,
quote
;
const
char
*
start
;
const
char
*
start
;
HRESULT
hr
=
WS_E_INVALID_FORMAT
;
HRESULT
hr
=
WS_E_INVALID_FORMAT
;
...
@@ -775,7 +775,8 @@ static HRESULT read_attribute( struct reader *reader, WS_XML_ATTRIBUTE **ret )
...
@@ -775,7 +775,8 @@ static HRESULT read_attribute( struct reader *reader, WS_XML_ATTRIBUTE **ret )
read_skip
(
reader
,
1
);
read_skip
(
reader
,
1
);
read_skip_whitespace
(
reader
);
read_skip_whitespace
(
reader
);
if
(
read_cmp
(
reader
,
"
\"
"
,
1
))
goto
error
;
if
(
read_cmp
(
reader
,
"
\"
"
,
1
)
&&
read_cmp
(
reader
,
"'"
,
1
))
goto
error
;
quote
=
read_utf8_char
(
reader
,
&
skip
);
read_skip
(
reader
,
1
);
read_skip
(
reader
,
1
);
len
=
0
;
len
=
0
;
...
@@ -783,7 +784,7 @@ static HRESULT read_attribute( struct reader *reader, WS_XML_ATTRIBUTE **ret )
...
@@ -783,7 +784,7 @@ static HRESULT read_attribute( struct reader *reader, WS_XML_ATTRIBUTE **ret )
for
(;;)
for
(;;)
{
{
if
(
!
(
ch
=
read_utf8_char
(
reader
,
&
skip
)))
goto
error
;
if
(
!
(
ch
=
read_utf8_char
(
reader
,
&
skip
)))
goto
error
;
if
(
ch
==
'"'
)
break
;
if
(
ch
==
quote
)
break
;
read_skip
(
reader
,
skip
);
read_skip
(
reader
,
skip
);
len
+=
skip
;
len
+=
skip
;
}
}
...
@@ -795,6 +796,7 @@ static HRESULT read_attribute( struct reader *reader, WS_XML_ATTRIBUTE **ret )
...
@@ -795,6 +796,7 @@ static HRESULT read_attribute( struct reader *reader, WS_XML_ATTRIBUTE **ret )
return
E_OUTOFMEMORY
;
return
E_OUTOFMEMORY
;
}
}
attr
->
value
=
(
WS_XML_TEXT
*
)
text
;
attr
->
value
=
(
WS_XML_TEXT
*
)
text
;
attr
->
singleQuote
=
(
quote
==
'\''
);
*
ret
=
attr
;
*
ret
=
attr
;
return
S_OK
;
return
S_OK
;
...
...
dlls/webservices/tests/reader.c
View file @
63e0b485
...
@@ -50,7 +50,7 @@ static const char data5[] =
...
@@ -50,7 +50,7 @@ static const char data5[] =
static
const
char
data6
[]
=
static
const
char
data6
[]
=
"<?xml version=
\"
1.0
\"
encoding=
\"
utf-8
\"
?>"
"<?xml version=
\"
1.0
\"
encoding=
\"
utf-8
\"
?>"
"<text attr=
\"
value
\"
>test</text>"
;
"<text attr=
\"
value
\"
attr2='value2'
>test</text>"
;
static
const
char
data8
[]
=
static
const
char
data8
[]
=
"<node1><node2>test</node2></node1>"
;
"<node1><node2>test</node2></node1>"
;
...
@@ -872,7 +872,7 @@ static void test_WsReadNode(void)
...
@@ -872,7 +872,7 @@ static void test_WsReadNode(void)
ok
(
elem
->
ns
!=
NULL
,
"ns not set
\n
"
);
ok
(
elem
->
ns
!=
NULL
,
"ns not set
\n
"
);
ok
(
!
elem
->
ns
->
length
,
"got %u
\n
"
,
elem
->
ns
->
length
);
ok
(
!
elem
->
ns
->
length
,
"got %u
\n
"
,
elem
->
ns
->
length
);
ok
(
elem
->
ns
->
bytes
!=
NULL
,
"bytes not set
\n
"
);
ok
(
elem
->
ns
->
bytes
!=
NULL
,
"bytes not set
\n
"
);
ok
(
elem
->
attributeCount
==
1
,
"got %u
\n
"
,
elem
->
attributeCount
);
ok
(
elem
->
attributeCount
==
2
,
"got %u
\n
"
,
elem
->
attributeCount
);
ok
(
elem
->
attributes
!=
NULL
,
"attributes not set
\n
"
);
ok
(
elem
->
attributes
!=
NULL
,
"attributes not set
\n
"
);
ok
(
!
elem
->
isEmpty
,
"isEmpty not zero
\n
"
);
ok
(
!
elem
->
isEmpty
,
"isEmpty not zero
\n
"
);
...
@@ -894,6 +894,25 @@ static void test_WsReadNode(void)
...
@@ -894,6 +894,25 @@ static void test_WsReadNode(void)
ok
(
attr
->
value
->
textType
==
WS_XML_TEXT_TYPE_UTF8
,
"got %u
\n
"
,
attr
->
value
->
textType
);
ok
(
attr
->
value
->
textType
==
WS_XML_TEXT_TYPE_UTF8
,
"got %u
\n
"
,
attr
->
value
->
textType
);
ok
(
text
->
value
.
length
==
5
,
"got %u
\n
"
,
text
->
value
.
length
);
ok
(
text
->
value
.
length
==
5
,
"got %u
\n
"
,
text
->
value
.
length
);
ok
(
!
memcmp
(
text
->
value
.
bytes
,
"value"
,
5
),
"wrong data
\n
"
);
ok
(
!
memcmp
(
text
->
value
.
bytes
,
"value"
,
5
),
"wrong data
\n
"
);
attr
=
elem
->
attributes
[
1
];
ok
(
attr
->
singleQuote
==
1
,
"got %u
\n
"
,
attr
->
singleQuote
);
ok
(
!
attr
->
isXmlNs
,
"got %u
\n
"
,
attr
->
isXmlNs
);
ok
(
attr
->
prefix
!=
NULL
,
"prefix not set
\n
"
);
ok
(
!
attr
->
prefix
->
length
,
"got %u
\n
"
,
attr
->
prefix
->
length
);
ok
(
attr
->
prefix
->
bytes
==
NULL
,
"bytes set
\n
"
);
ok
(
attr
->
localName
!=
NULL
,
"localName not set
\n
"
);
ok
(
attr
->
localName
->
length
==
5
,
"got %u
\n
"
,
attr
->
localName
->
length
);
ok
(
!
memcmp
(
attr
->
localName
->
bytes
,
"attr2"
,
5
),
"wrong data
\n
"
);
ok
(
attr
->
ns
!=
NULL
,
"ns not set
\n
"
);
ok
(
!
attr
->
ns
->
length
,
"got %u
\n
"
,
attr
->
ns
->
length
);
ok
(
attr
->
ns
->
bytes
==
NULL
,
"bytes set
\n
"
);
ok
(
attr
->
value
!=
NULL
,
"value not set
\n
"
);
text
=
(
WS_XML_UTF8_TEXT
*
)
attr
->
value
;
ok
(
attr
->
value
->
textType
==
WS_XML_TEXT_TYPE_UTF8
,
"got %u
\n
"
,
attr
->
value
->
textType
);
ok
(
text
->
value
.
length
==
6
,
"got %u
\n
"
,
text
->
value
.
length
);
ok
(
!
memcmp
(
text
->
value
.
bytes
,
"value2"
,
6
),
"wrong data
\n
"
);
}
}
WsFreeReader
(
reader
);
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