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
40992ee8
Commit
40992ee8
authored
Apr 27, 2016
by
Jacek Caban
Committed by
Alexandre Julliard
Apr 27, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wininet: Simplify handling ICU_DECODE in InternetCrackUrlW.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
d10c5b4a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
24 deletions
+12
-24
internet.c
dlls/wininet/internet.c
+12
-24
No files found.
dlls/wininet/internet.c
View file @
40992ee8
...
...
@@ -1737,8 +1737,7 @@ static BOOL SetUrlComponentValueW(LPWSTR* lppszComponent, LPDWORD dwComponentLen
* TRUE on success
* FALSE on failure
*/
BOOL
WINAPI
InternetCrackUrlW
(
LPCWSTR
lpszUrl_orig
,
DWORD
dwUrlLength_orig
,
DWORD
dwFlags
,
LPURL_COMPONENTSW
lpUC
)
BOOL
WINAPI
InternetCrackUrlW
(
const
WCHAR
*
lpszUrl
,
DWORD
dwUrlLength
,
DWORD
dwFlags
,
URL_COMPONENTSW
*
lpUC
)
{
/*
* RFC 1808
...
...
@@ -1747,18 +1746,16 @@ BOOL WINAPI InternetCrackUrlW(LPCWSTR lpszUrl_orig, DWORD dwUrlLength_orig, DWOR
*/
LPCWSTR
lpszParam
=
NULL
;
BOOL
found_colon
=
FALSE
;
LPCWSTR
lpszap
,
lpszUrl
=
lpszUrl_orig
;
LPCWSTR
lpszap
;
LPCWSTR
lpszcp
=
NULL
,
lpszNetLoc
;
LPWSTR
lpszUrl_decode
=
NULL
;
DWORD
dwUrlLength
=
dwUrlLength_orig
;
TRACE
(
"(%s %u %x %p)
\n
"
,
lpszUrl
?
debugstr_wn
(
lpszUrl
,
dwUrlLength
?
dwUrlLength
:
strlenW
(
lpszUrl
))
:
"(null)"
,
dwUrlLength
,
dwFlags
,
lpUC
);
if
(
!
lpszUrl
_orig
||
!*
lpszUrl_orig
||
!
lpUC
)
if
(
!
lpszUrl
||
!*
lpszUrl
||
!
lpUC
)
{
INTERNET_
SetLastError
(
ERROR_INVALID_PARAMETER
);
SetLastError
(
ERROR_INVALID_PARAMETER
);
return
FALSE
;
}
if
(
!
dwUrlLength
)
dwUrlLength
=
strlenW
(
lpszUrl
);
...
...
@@ -1767,26 +1764,18 @@ BOOL WINAPI InternetCrackUrlW(LPCWSTR lpszUrl_orig, DWORD dwUrlLength_orig, DWOR
{
WCHAR
*
url_tmp
;
DWORD
len
=
dwUrlLength
+
1
;
BOOL
ret
;
if
(
!
(
url_tmp
=
heap_
alloc
(
len
*
sizeof
(
WCHAR
)
)))
if
(
!
(
url_tmp
=
heap_
strndupW
(
lpszUrl
,
dwUrlLength
)))
{
INTERNET_
SetLastError
(
ERROR_OUTOFMEMORY
);
SetLastError
(
ERROR_OUTOFMEMORY
);
return
FALSE
;
}
memcpy
(
url_tmp
,
lpszUrl_orig
,
dwUrlLength
*
sizeof
(
WCHAR
));
url_tmp
[
dwUrlLength
]
=
0
;
if
(
!
(
lpszUrl_decode
=
heap_alloc
(
len
*
sizeof
(
WCHAR
))))
{
heap_free
(
url_tmp
);
INTERNET_SetLastError
(
ERROR_OUTOFMEMORY
);
return
FALSE
;
}
if
(
InternetCanonicalizeUrlW
(
url_tmp
,
lpszUrl_decode
,
&
len
,
ICU_DECODE
|
ICU_NO_ENCODE
))
{
dwUrlLength
=
len
;
lpszUrl
=
lpszUrl_decode
;
}
ret
=
InternetCanonicalizeUrlW
(
url_tmp
,
url_tmp
,
&
len
,
ICU_DECODE
|
ICU_NO_ENCODE
);
if
(
ret
)
ret
=
InternetCrackUrlW
(
url_tmp
,
len
,
dwFlags
&
~
ICU_DECODE
,
lpUC
);
heap_free
(
url_tmp
);
return
ret
;
}
lpszap
=
lpszUrl
;
...
...
@@ -1989,7 +1978,7 @@ BOOL WINAPI InternetCrackUrlW(LPCWSTR lpszUrl_orig, DWORD dwUrlLength_orig, DWOR
if
(
*
lpszcp
==
'/'
)
{
len
=
MAX_PATH
;
PathCreateFromUrlW
(
lpszUrl
_orig
,
tmppath
,
&
len
,
0
);
PathCreateFromUrlW
(
lpszUrl
,
tmppath
,
&
len
,
0
);
}
else
{
...
...
@@ -2036,7 +2025,6 @@ BOOL WINAPI InternetCrackUrlW(LPCWSTR lpszUrl_orig, DWORD dwUrlLength_orig, DWOR
debugstr_wn
(
lpUC
->
lpszUrlPath
,
lpUC
->
dwUrlPathLength
),
debugstr_wn
(
lpUC
->
lpszExtraInfo
,
lpUC
->
dwExtraInfoLength
));
heap_free
(
lpszUrl_decode
);
return
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