Module: wine Branch: master Commit: 5b76702e84652832ba21ca22afb4544c5f6fb95a URL: http://source.winehq.org/git/wine.git/?a=commit;h=5b76702e84652832ba21ca22af...
Author: Jacek Caban jacek@codeweavers.com Date: Wed Dec 9 22:09:06 2009 +0100
wininet: Set lpszUrlPath in InternetCrackUrlW if its length is 0.
---
dlls/wininet/internet.c | 2 +- dlls/wininet/tests/url.c | 17 ++++++++++++----- 2 files changed, 13 insertions(+), 6 deletions(-)
diff --git a/dlls/wininet/internet.c b/dlls/wininet/internet.c index ac845a8..d749e53 100644 --- a/dlls/wininet/internet.c +++ b/dlls/wininet/internet.c @@ -1603,7 +1603,7 @@ BOOL WINAPI InternetCrackUrlW(LPCWSTR lpszUrl_orig, DWORD dwUrlLength_orig, DWOR * <protocol>:[//<net_loc>][/path][;<params>][?<query>][#<fragment>] * ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ */ - if (lpszcp != 0 && lpszcp - lpszUrl < dwUrlLength && (!lpszParam || lpszcp < lpszParam)) + if (lpszcp != 0 && lpszcp - lpszUrl < dwUrlLength && (!lpszParam || lpszcp <= lpszParam)) { INT len;
diff --git a/dlls/wininet/tests/url.c b/dlls/wininet/tests/url.c index 527c2c7..7439cd3 100644 --- a/dlls/wininet/tests/url.c +++ b/dlls/wininet/tests/url.c @@ -94,6 +94,7 @@ typedef struct { INTERNET_SCHEME scheme; int host_off; int host_len; + int host_skip_broken; INTERNET_PORT port; int user_off; int user_len; @@ -107,15 +108,17 @@ typedef struct {
static const crack_url_test_t crack_url_tests[] = { {"http://www.winehq.org/site/about#hi", - 0, 4, INTERNET_SCHEME_HTTP, 7, 14, 80, -1, 0, -1, 0, 21, 11, 32, 3}, + 0, 4, INTERNET_SCHEME_HTTP, 7, 14, -1, 80, -1, 0, -1, 0, 21, 11, 32, 3}, {"http://www.myserver.com/myscript.php?arg=1", - 0, 4, INTERNET_SCHEME_HTTP, 7, 16, 80, -1, 0, -1, 0, 23, 13, 36, 6}, + 0, 4, INTERNET_SCHEME_HTTP, 7, 16, -1, 80, -1, 0, -1, 0, 23, 13, 36, 6}, + {"http://www.winehq.org?test=123", + 0, 4, INTERNET_SCHEME_HTTP, 7, 14, 23, 80, -1, 0, -1, 0, 21, 0, 21, 9}, {"file:///C:/Program%20Files/Atmel/AVR%20Tools/STK500/STK500.xml", - 0, 4, INTERNET_SCHEME_FILE, -1, 0, 0, -1, 0, -1, 0, 7, 55, -1, 0}, + 0, 4, INTERNET_SCHEME_FILE, -1, 0, -1, 0, -1, 0, -1, 0, 7, 55, -1, 0}, {"fide:///C:/Program%20Files/Atmel/AVR%20Tools/STK500/STK500.xml", - 0, 4, INTERNET_SCHEME_UNKNOWN, 7, 0, 0, -1, 0, -1, 0, 7, 55, -1, 0}, + 0, 4, INTERNET_SCHEME_UNKNOWN, 7, 0, -1, 0, -1, 0, -1, 0, 7, 55, -1, 0}, {"file://C:/Program%20Files/Atmel/AVR%20Tools/STK500/STK500.xml", - 0, 4, INTERNET_SCHEME_FILE, -1, 0, 0, -1, 0, -1, 0, 7, 54, -1, 0}, + 0, 4, INTERNET_SCHEME_FILE, -1, 0, -1, 0, -1, 0, -1, 0, 7, 54, -1, 0}, };
static void test_crack_url(const crack_url_test_t *test) @@ -143,6 +146,10 @@ static void test_crack_url(const crack_url_test_t *test) else ok(url.lpszHostName == test->url+test->host_off, "[%s] url.lpszHostName = %p, expected %p\n", test->url, url.lpszHostName, test->url+test->host_off); + if(test->host_skip_broken != -1 && url.dwHostNameLength == test->host_skip_broken) { + win_skip("skipping broken dwHostNameLength result\n"); + return; + } ok(url.dwHostNameLength == test->host_len, "[%s] url.lpszHostNameLength = %d, expected %d\n", test->url, url.dwHostNameLength, test->host_len);