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
1a56a73c
Commit
1a56a73c
authored
Sep 21, 2012
by
Jacek Caban
Committed by
Alexandre Julliard
Sep 21, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
itss: Canonicalize relative paths before resolving object.
parent
e75683b8
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
54 additions
and
0 deletions
+54
-0
protocol.c
dlls/itss/protocol.c
+51
-0
protocol.c
dlls/itss/tests/protocol.c
+3
-0
No files found.
dlls/itss/protocol.c
View file @
1a56a73c
...
...
@@ -134,6 +134,55 @@ static LPCWSTR skip_schema(LPCWSTR url)
return
NULL
;
}
/* Adopted from urlmon */
static
void
remove_dot_segments
(
WCHAR
*
path
)
{
const
WCHAR
*
in
=
path
;
WCHAR
*
out
=
path
;
while
(
1
)
{
/* Move the first path segment in the input buffer to the end of
* the output buffer, and any subsequent characters up to, including
* the next "/" character (if any) or the end of the input buffer.
*/
while
(
*
in
!=
'/'
)
{
if
(
!
(
*
out
++
=
*
in
++
))
return
;
}
*
out
++
=
*
in
++
;
while
(
*
in
)
{
if
(
*
in
!=
'.'
)
break
;
/* Handle ending "/." */
if
(
!
in
[
1
])
{
++
in
;
break
;
}
/* Handle "/./" */
if
(
in
[
1
]
==
'/'
)
{
in
+=
2
;
continue
;
}
/* If we don't have "/../" or ending "/.." */
if
(
in
[
1
]
!=
'.'
||
(
in
[
2
]
&&
in
[
2
]
!=
'/'
))
break
;
in
+=
*
in
?
3
:
2
;
/* Find the slash preceding out pointer and move out pointer to it */
if
(
out
>
path
+
1
&&
*--
out
==
'/'
)
--
out
;
while
(
out
>
path
&&
*
(
--
out
)
!=
'/'
);
if
(
*
out
==
'/'
)
++
out
;
}
}
}
static
HRESULT
report_result
(
IInternetProtocolSink
*
sink
,
HRESULT
hres
)
{
IInternetProtocolSink_ReportResult
(
sink
,
hres
,
0
,
NULL
);
...
...
@@ -215,6 +264,8 @@ static HRESULT WINAPI ITSProtocol_Start(IInternetProtocol *iface, LPCWSTR szUrl,
*
p
=
'/'
;
}
remove_dot_segments
(
object_name
);
TRACE
(
"Resolving %s
\n
"
,
debugstr_w
(
object_name
));
memset
(
&
chm_object
,
0
,
sizeof
(
chm_object
));
...
...
dlls/itss/tests/protocol.c
View file @
1a56a73c
...
...
@@ -87,6 +87,8 @@ static const WCHAR blank_url7[] = {'m','k',':','@','M','S','I','T','S','t','o','
't'
,
'e'
,
's'
,
't'
,
'.'
,
'c'
,
'h'
,
'm'
,
':'
,
':'
,
'\\'
,
'b'
,
'l'
,
'a'
,
'n'
,
'k'
,
'.'
,
'h'
,
't'
,
'm'
,
'l'
,
0
};
static
const
WCHAR
blank_url8
[]
=
{
'm'
,
'k'
,
':'
,
'@'
,
'M'
,
'S'
,
'I'
,
'T'
,
'S'
,
't'
,
'o'
,
'r'
,
'e'
,
':'
,
't'
,
'e'
,
's'
,
't'
,
'.'
,
'c'
,
'h'
,
'm'
,
':'
,
':'
,
'/'
,
'b'
,
'l'
,
'a'
,
'n'
,
'k'
,
'.'
,
'h'
,
't'
,
'm'
,
'l'
,
'/'
,
0
};
static
const
WCHAR
blank_url9
[]
=
{
'i'
,
't'
,
's'
,
':'
,
't'
,
'e'
,
's'
,
't'
,
'.'
,
'c'
,
'h'
,
'm'
,
':'
,
':'
,
'/'
,
'd'
,
'i'
,
'r'
,
'/'
,
'.'
,
'.'
,
'/'
,
'b'
,
'l'
,
'a'
,
'n'
,
'k'
,
'.'
,
'h'
,
't'
,
'm'
,
'l'
,
0
};
static
enum
{
ITS_PROTOCOL
,
...
...
@@ -612,6 +614,7 @@ static void test_its_protocol(void)
test_protocol_url
(
factory
,
blank_url5
,
TRUE
);
test_protocol_url
(
factory
,
blank_url6
,
TRUE
);
test_protocol_url
(
factory
,
blank_url8
,
TRUE
);
test_protocol_url
(
factory
,
blank_url9
,
TRUE
);
bindf
=
BINDF_FROMURLMON
|
BINDF_NEEDFILE
;
test_protocol_url
(
factory
,
blank_url1
,
TRUE
);
}
...
...
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