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
c79c8494
Commit
c79c8494
authored
Apr 20, 2010
by
Alistair Leslie-Hughes
Committed by
Alexandre Julliard
Apr 20, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
urlmon: Strip forward and back slashes when using the file: protocol.
parent
9eaab2ce
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
1 deletion
+19
-1
file.c
dlls/urlmon/file.c
+4
-1
protocol.c
dlls/urlmon/tests/protocol.c
+15
-0
No files found.
dlls/urlmon/file.c
View file @
c79c8494
...
...
@@ -141,7 +141,10 @@ static HRESULT WINAPI FileProtocol_Start(IInternetProtocol *iface, LPCWSTR szUrl
IInternetProtocolSink_ReportProgress
(
pOIProtSink
,
BINDSTATUS_SENDINGREQUEST
,
&
null_char
);
file_name
=
url
+
sizeof
(
wszFile
)
/
sizeof
(
WCHAR
);
if
(
file_name
[
0
]
==
'/'
&&
file_name
[
1
]
==
'/'
)
/* Strip both forward and back slashes */
if
(
(
file_name
[
0
]
==
'/'
&&
file_name
[
1
]
==
'/'
)
||
(
file_name
[
0
]
==
'\\'
&&
file_name
[
1
]
==
'\\'
))
file_name
+=
2
;
if
(
*
file_name
==
'/'
)
file_name
++
;
...
...
dlls/urlmon/tests/protocol.c
View file @
c79c8494
...
...
@@ -2241,6 +2241,7 @@ static void test_file_protocol(void) {
static
const
WCHAR
wszFile
[]
=
{
'f'
,
'i'
,
'l'
,
'e'
,
':'
,
0
};
static
const
WCHAR
wszFile2
[]
=
{
'f'
,
'i'
,
'l'
,
'e'
,
':'
,
'/'
,
'/'
,
0
};
static
const
WCHAR
wszFile3
[]
=
{
'f'
,
'i'
,
'l'
,
'e'
,
':'
,
'/'
,
'/'
,
'/'
,
0
};
static
const
WCHAR
wszFile4
[]
=
{
'f'
,
'i'
,
'l'
,
'e'
,
':'
,
'\\'
,
'\\'
,
0
};
static
const
char
html_doc
[]
=
"<HTML></HTML>"
;
trace
(
"Testing file protocol...
\n
"
);
...
...
@@ -2306,6 +2307,20 @@ static void test_file_protocol(void) {
bindf
=
BINDF_FROMURLMON
;
test_file_protocol_url
(
buf
);
memcpy
(
buf
,
wszFile4
,
sizeof
(
wszFile4
));
len
=
GetCurrentDirectoryW
(
sizeof
(
file_name_buf
)
/
sizeof
(
WCHAR
),
file_name_buf
);
file_name_buf
[
len
++
]
=
'\\'
;
memcpy
(
file_name_buf
+
len
,
wszIndexHtml
,
sizeof
(
wszIndexHtml
));
lstrcpyW
(
buf
+
sizeof
(
wszFile4
)
/
sizeof
(
WCHAR
)
-
1
,
file_name_buf
);
file_name
=
file_name_buf
;
bindf
=
0
;
test_file_protocol_url
(
buf
);
bindf
=
BINDF_FROMURLMON
;
test_file_protocol_url
(
buf
);
buf
[
sizeof
(
wszFile4
)
/
sizeof
(
WCHAR
)]
=
'|'
;
test_file_protocol_url
(
buf
);
DeleteFileW
(
wszIndexHtml
);
bindf
=
0
;
...
...
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