Module: wine Branch: master Commit: cacad1df98aceee3b2bf4f9a9c6978287b897be6 URL: http://source.winehq.org/git/wine.git/?a=commit;h=cacad1df98aceee3b2bf4f9a9c...
Author: Michael Müller michael@fds-team.de Date: Fri Jul 8 12:07:43 2016 +0200
wininet: Correctly set lpszUrlPath in InternetCrackUrlW for urls without path component.
Signed-off-by: Michael Müller michael@fds-team.de Signed-off-by: Sebastian Lackner sebastian@fds-team.de Signed-off-by: Jacek Caban jacek@codeweavers.com Signed-off-by: Alexandre Julliard julliard@winehq.org
---
dlls/wininet/internet.c | 4 +--- dlls/wininet/tests/url.c | 3 +++ 2 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/dlls/wininet/internet.c b/dlls/wininet/internet.c index 19cf470..4e1f3b9 100644 --- a/dlls/wininet/internet.c +++ b/dlls/wininet/internet.c @@ -1917,9 +1917,7 @@ BOOL WINAPI InternetCrackUrlW(const WCHAR *lpszUrl, DWORD dwUrlLength, DWORD dwF } else { - if (lpUC->lpszUrlPath && (lpUC->dwUrlPathLength > 0)) - lpUC->lpszUrlPath[0] = 0; - lpUC->dwUrlPathLength = 0; + set_url_component(&lpUC->lpszUrlPath, &lpUC->dwUrlPathLength, lpszcp, 0); }
TRACE("%s: scheme(%s) host(%s) path(%s) extra(%s)\n", debugstr_wn(lpszUrl,dwUrlLength), diff --git a/dlls/wininet/tests/url.c b/dlls/wininet/tests/url.c index 00a457a..0af1d77 100644 --- a/dlls/wininet/tests/url.c +++ b/dlls/wininet/tests/url.c @@ -130,6 +130,9 @@ static const crack_url_test_t crack_url_tests[] = { {"HtTp://www.winehq.org/scheme", 0, 4, INTERNET_SCHEME_HTTP, 7, 14, 23, 80, -1, 0, -1, 0, 21, 7, -1, 0, "HtTp", "www.winehq.org", "", "", "/scheme", ""}, + {"http://www.winehq.org", + 0, 4, INTERNET_SCHEME_HTTP, 7, 14, 23, 80, -1, 0, -1, 0, 21, 0, -1, 0, + "http", "www.winehq.org", "", "", "", ""}, {"file:///C:/Program%20Files/Atmel/AVR%20Tools/STK500/STK500.xml", 0, 4, INTERNET_SCHEME_FILE, -1, 0, -1, 0, -1, 0, -1, 0, 7, 55, -1, 0, "file", "", "", "", "C:\Program Files\Atmel\AVR Tools\STK500\STK500.xml", ""},