shlwapi: Allow ' ' in hostname and password in UrlGetPart.

This commit is contained in:
Piotr Caban 2009-12-15 23:47:17 +01:00 committed by Alexandre Julliard
parent c23b0b0b48
commit 1e0827f645
2 changed files with 12 additions and 2 deletions

View File

@ -519,6 +519,9 @@ static void test_url_part(const char* szUrl, DWORD dwPart, DWORD dwFlags, const
static void test_UrlGetPart(void)
{
const char* file_url = "file://h o s t/c:/windows/file";
const char* http_url = "http://user:pass 123@www.wine hq.org";
CHAR szPart[INTERNET_MAX_URL_LENGTH];
DWORD dwSize;
HRESULT res;
@ -544,6 +547,11 @@ static void test_UrlGetPart(void)
test_url_part(TEST_URL_3, URL_PART_PASSWORD, 0, "bar");
test_url_part(TEST_URL_3, URL_PART_SCHEME, 0, "http");
test_url_part(TEST_URL_3, URL_PART_QUERY, 0, "?query=x&return=y");
test_url_part(file_url, URL_PART_HOSTNAME, 0, "h o s t");
test_url_part(http_url, URL_PART_HOSTNAME, 0, "www.wine hq.org");
test_url_part(http_url, URL_PART_PASSWORD, 0, "pass 123");
}
/* ########################### */

View File

@ -1856,7 +1856,8 @@ static LPCWSTR URL_ScanID(LPCWSTR start, LPDWORD size, WINE_URL_SCAN_TYPE type)
(*start == '_') ||
(*start == '+') ||
(*start == '-') ||
(*start == '.')) {
(*start == '.') ||
(*start == ' ')) {
start++;
(*size)++;
} else if (*start == '%') {
@ -1886,7 +1887,8 @@ static LPCWSTR URL_ScanID(LPCWSTR start, LPDWORD size, WINE_URL_SCAN_TYPE type)
while (cont) {
if (isalnumW(*start) ||
(*start == '-') ||
(*start == '.') ) {
(*start == '.') ||
(*start == ' ') ) {
start++;
(*size)++;
}