diff --git a/dlls/shlwapi/tests/url.c b/dlls/shlwapi/tests/url.c index 4dd5d9c0f95..3d86ae7c5e1 100644 --- a/dlls/shlwapi/tests/url.c +++ b/dlls/shlwapi/tests/url.c @@ -570,6 +570,7 @@ 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"; + const char* about_url = "about:blank"; CHAR szPart[INTERNET_MAX_URL_LENGTH]; DWORD dwSize; @@ -607,6 +608,12 @@ static void test_UrlGetPart(void) test_url_part(http_url, URL_PART_HOSTNAME, 0, "www.wine hq.org"); test_url_part(http_url, URL_PART_PASSWORD, 0, "pass 123"); + test_url_part(about_url, URL_PART_SCHEME, 0, "about"); + + dwSize = sizeof(szPart); + res = pUrlGetPartA(about_url, szPart, &dwSize, URL_PART_HOSTNAME, 0); + ok(res==E_FAIL, "returned %08x\n", res); + dwSize = sizeof(szPart); res = pUrlGetPartA("file://c:\\index.htm", szPart, &dwSize, URL_PART_HOSTNAME, 0); ok(res==S_FALSE, "returned %08x\n", res); diff --git a/dlls/shlwapi/url.c b/dlls/shlwapi/url.c index d3dea24d4f4..4a93b23b5c1 100644 --- a/dlls/shlwapi/url.c +++ b/dlls/shlwapi/url.c @@ -1938,7 +1938,7 @@ static LONG URL_ParseUrl(LPCWSTR pszUrl, WINE_PARSE_URL *pl) work = URL_ScanID(pl->pScheme, &pl->szScheme, SCHEME); if (!*work || (*work != ':')) goto ErrorExit; work++; - if ((*work != '/') || (*(work+1) != '/')) goto ErrorExit; + if ((*work != '/') || (*(work+1) != '/')) goto SuccessExit; pl->pUserName = work + 2; work = URL_ScanID(pl->pUserName, &pl->szUserName, USERPASS); if (*work == ':' ) { @@ -1979,6 +1979,7 @@ static LONG URL_ParseUrl(LPCWSTR pszUrl, WINE_PARSE_URL *pl) pl->pQuery = strchrW(work, '?'); if (pl->pQuery) pl->szQuery = strlenW(pl->pQuery); } + SuccessExit: TRACE("parse successful: scheme=%p(%d), user=%p(%d), pass=%p(%d), host=%p(%d), port=%p(%d), query=%p(%d)\n", pl->pScheme, pl->szScheme, pl->pUserName, pl->szUserName,