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
3555226a
Commit
3555226a
authored
Oct 05, 2010
by
Andrew Eikum
Committed by
Alexandre Julliard
Oct 06, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wininet: Clean up returned UrlPath for file protocol URLs.
parent
52aab76e
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
42 additions
and
3 deletions
+42
-3
internet.c
dlls/wininet/internet.c
+42
-3
url.c
dlls/wininet/tests/url.c
+0
-0
No files found.
dlls/wininet/internet.c
View file @
3555226a
...
...
@@ -1370,8 +1370,9 @@ BOOL WINAPI InternetCrackUrlA(LPCSTR lpszUrl, DWORD dwUrlLength, DWORD dwFlags,
InternetCrackUrlW should not include it */
if
(
dwUrlLength
==
-
1
)
nLength
--
;
lpwszUrl
=
HeapAlloc
(
GetProcessHeap
(),
0
,
nLength
*
sizeof
(
WCHAR
));
MultiByteToWideChar
(
CP_ACP
,
0
,
lpszUrl
,
dwUrlLength
,
lpwszUrl
,
nLength
);
lpwszUrl
=
HeapAlloc
(
GetProcessHeap
(),
0
,
(
nLength
+
1
)
*
sizeof
(
WCHAR
));
MultiByteToWideChar
(
CP_ACP
,
0
,
lpszUrl
,
dwUrlLength
,
lpwszUrl
,
nLength
+
1
);
lpwszUrl
[
nLength
]
=
'\0'
;
memset
(
&
UCW
,
0
,
sizeof
(
UCW
));
UCW
.
dwStructSize
=
sizeof
(
URL_COMPONENTSW
);
...
...
@@ -1788,7 +1789,7 @@ BOOL WINAPI InternetCrackUrlW(LPCWSTR lpszUrl_orig, DWORD dwUrlLength_orig, DWOR
*/
if
(
lpszcp
!=
0
&&
lpszcp
-
lpszUrl
<
dwUrlLength
&&
(
!
lpszParam
||
lpszcp
<=
lpszParam
))
{
INT
len
;
DWORD
len
;
/* Only truncate the parameter list if it's already been saved
* in lpUC->lpszExtraInfo.
...
...
@@ -1806,6 +1807,44 @@ BOOL WINAPI InternetCrackUrlW(LPCWSTR lpszUrl_orig, DWORD dwUrlLength_orig, DWOR
else
len
=
dwUrlLength
-
(
lpszcp
-
lpszUrl
);
}
if
(
lpUC
->
dwUrlPathLength
&&
lpUC
->
lpszUrlPath
&&
lpUC
->
nScheme
==
INTERNET_SCHEME_FILE
)
{
WCHAR
tmppath
[
MAX_PATH
];
if
(
*
lpszcp
==
'/'
)
{
len
=
MAX_PATH
;
PathCreateFromUrlW
(
lpszUrl_orig
,
tmppath
,
&
len
,
0
);
}
else
{
WCHAR
*
iter
;
memcpy
(
tmppath
,
lpszcp
,
len
*
sizeof
(
WCHAR
));
tmppath
[
len
]
=
'\0'
;
iter
=
tmppath
;
while
(
*
iter
)
{
if
(
*
iter
==
'/'
)
*
iter
=
'\\'
;
++
iter
;
}
}
/* if ends in \. or \.. append a backslash */
if
(
tmppath
[
len
-
1
]
==
'.'
&&
(
tmppath
[
len
-
2
]
==
'\\'
||
(
tmppath
[
len
-
2
]
==
'.'
&&
tmppath
[
len
-
3
]
==
'\\'
)))
{
if
(
len
<
MAX_PATH
-
1
)
{
tmppath
[
len
]
=
'\\'
;
tmppath
[
len
+
1
]
=
'\0'
;
++
len
;
}
}
SetUrlComponentValueW
(
&
lpUC
->
lpszUrlPath
,
&
lpUC
->
dwUrlPathLength
,
tmppath
,
len
);
}
else
SetUrlComponentValueW
(
&
lpUC
->
lpszUrlPath
,
&
lpUC
->
dwUrlPathLength
,
lpszcp
,
len
);
}
...
...
dlls/wininet/tests/url.c
View file @
3555226a
This diff is collapsed.
Click to expand it.
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