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
979a43e4
Commit
979a43e4
authored
Dec 18, 2007
by
Huw Davies
Committed by
Alexandre Julliard
Dec 18, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
inetcomm: Unquote parameter values.
parent
e446351d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
57 additions
and
5 deletions
+57
-5
mimeole.c
dlls/inetcomm/mimeole.c
+34
-1
mimeole.c
dlls/inetcomm/tests/mimeole.c
+23
-4
No files found.
dlls/inetcomm/mimeole.c
View file @
979a43e4
...
...
@@ -268,6 +268,39 @@ static void unfold_header(char *header, int len)
*
(
start
-
1
)
=
'\0'
;
}
static
char
*
unquote_string
(
const
char
*
str
)
{
int
quoted
=
0
;
char
*
ret
,
*
cp
;
while
(
*
str
==
' '
||
*
str
==
'\t'
)
str
++
;
if
(
*
str
==
'"'
)
{
quoted
=
1
;
str
++
;
}
ret
=
strdupA
(
str
);
for
(
cp
=
ret
;
*
cp
;
cp
++
)
{
if
(
*
cp
==
'\\'
)
memmove
(
cp
,
cp
+
1
,
strlen
(
cp
+
1
)
+
1
);
else
if
(
*
cp
==
'"'
)
{
if
(
!
quoted
)
{
WARN
(
"quote in unquoted string
\n
"
);
}
else
{
*
cp
=
'\0'
;
break
;
}
}
}
return
ret
;
}
static
void
add_param
(
header_t
*
header
,
const
char
*
p
)
{
const
char
*
key
=
p
,
*
value
,
*
cp
=
p
;
...
...
@@ -293,7 +326,7 @@ static void add_param(header_t *header, const char *p)
param
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
*
param
));
param
->
name
=
name
;
param
->
value
=
strdupA
(
value
);
param
->
value
=
unquote_string
(
value
);
list_add_tail
(
&
header
->
params
,
&
param
->
entry
);
}
...
...
dlls/inetcomm/tests/mimeole.c
View file @
979a43e4
...
...
@@ -36,7 +36,8 @@ static char msg1[] =
"MIME-Version: 1.0
\r\n
"
"Content-Type: multipart/mixed;
\r\n
"
" boundary=
\"
------------1.5.0.6
\"
;
\r\n
"
" stuff=
\"
du;nno
\"\r\n
"
" stuff=
\"
du;nno
\"
;
\r\n
"
" morestuff=
\"
so
\\\\
me
\\\"
thing
\\\"\"\r\n
"
"foo: bar
\r\n
"
"From: Huw Davies <huw@codeweavers.com>
\r\n
"
"From: Me <xxx@codeweavers.com>
\r\n
"
...
...
@@ -90,7 +91,7 @@ static void test_CreateBody(void)
LARGE_INTEGER
off
;
ULARGE_INTEGER
pos
;
ENCODINGTYPE
enc
;
ULONG
count
;
ULONG
count
,
found_param
,
i
;
MIMEPARAMINFO
*
param_info
;
IMimeAllocator
*
alloc
;
...
...
@@ -119,7 +120,7 @@ static void test_CreateBody(void)
ok
(
hr
==
S_OK
,
"ret %08x
\n
"
,
hr
);
off
.
QuadPart
=
0
;
IStream_Seek
(
in
,
off
,
STREAM_SEEK_CUR
,
&
pos
);
ok
(
pos
.
u
.
LowPart
==
3
28
,
"pos %u
\n
"
,
pos
.
u
.
LowPart
);
ok
(
pos
.
u
.
LowPart
==
3
59
,
"pos %u
\n
"
,
pos
.
u
.
LowPart
);
hr
=
IMimeBody_IsContentType
(
body
,
"multipart"
,
"mixed"
);
ok
(
hr
==
S_OK
,
"ret %08x
\n
"
,
hr
);
...
...
@@ -153,9 +154,27 @@ static void test_CreateBody(void)
hr
=
IMimeBody_GetParameters
(
body
,
"Content-Type"
,
&
count
,
&
param_info
);
ok
(
hr
==
S_OK
,
"ret %08x
\n
"
,
hr
);
todo_wine
/* native adds a charset parameter */
ok
(
count
==
3
,
"got %d
\n
"
,
count
);
ok
(
count
==
4
,
"got %d
\n
"
,
count
);
ok
(
param_info
!=
NULL
,
"got %p
\n
"
,
param_info
);
found_param
=
0
;
for
(
i
=
0
;
i
<
count
;
i
++
)
{
if
(
!
strcmp
(
param_info
[
i
].
pszName
,
"morestuff"
))
{
found_param
++
;
ok
(
!
strcmp
(
param_info
[
i
].
pszData
,
"so
\\
me
\"
thing
\"
"
),
"got %s
\n
"
,
param_info
[
i
].
pszData
);
}
else
if
(
!
strcmp
(
param_info
[
i
].
pszName
,
"stuff"
))
{
found_param
++
;
ok
(
!
strcmp
(
param_info
[
i
].
pszData
,
"du;nno"
),
"got %s
\n
"
,
param_info
[
i
].
pszData
);
}
}
ok
(
found_param
==
2
,
"matched %d params
\n
"
,
found_param
);
hr
=
IMimeAllocator_FreeParamInfoArray
(
alloc
,
count
,
param_info
,
TRUE
);
ok
(
hr
==
S_OK
,
"ret %08x
\n
"
,
hr
);
IMimeAllocator_Release
(
alloc
);
...
...
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