=?UTF-8?Q?Michael=20M=C3=BCller=20?=: wininet: Correctly set lpszUrlPath in InternetCrackUrlW for urls without path component.

Alexandre Julliard julliard at winehq.org
Fri Jul 8 10:02:06 CDT 2016


Module: wine
Branch: master
Commit: cacad1df98aceee3b2bf4f9a9c6978287b897be6
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=cacad1df98aceee3b2bf4f9a9c6978287b897be6

Author: Michael Müller <michael at 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 at fds-team.de>
Signed-off-by: Sebastian Lackner <sebastian at fds-team.de>
Signed-off-by: Jacek Caban <jacek at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at 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", ""},




More information about the wine-cvs mailing list