Commit 2e1bec52 authored by Sergey Khodych's avatar Sergey Khodych Committed by Alexandre Julliard

shlwapi: Don't copy valid scheme in UrlApplySchemeW.

parent 2034439d
......@@ -85,6 +85,10 @@ static const TEST_URL_APPLY TEST_APPLY[] = {
{"winehq.org", URL_APPLY_GUESSSCHEME | URL_APPLY_DEFAULT, S_OK, 17, "http://winehq.org"},
{"winehq.org", URL_APPLY_GUESSSCHEME, S_FALSE, TEST_APPLY_MAX_LENGTH, untouchedA},
{"winehq.org", URL_APPLY_DEFAULT, S_OK, 17, "http://winehq.org"},
{"http://www.winehq.org", URL_APPLY_GUESSSCHEME , S_FALSE, TEST_APPLY_MAX_LENGTH, untouchedA},
{"http://www.winehq.org", URL_APPLY_GUESSSCHEME | URL_APPLY_FORCEAPPLY, S_FALSE, TEST_APPLY_MAX_LENGTH, untouchedA},
{"http://www.winehq.org", URL_APPLY_GUESSSCHEME | URL_APPLY_FORCEAPPLY | URL_APPLY_DEFAULT, S_OK, 28, "http://http://www.winehq.org"},
{"http://www.winehq.org", URL_APPLY_GUESSSCHEME | URL_APPLY_DEFAULT, S_FALSE, TEST_APPLY_MAX_LENGTH, untouchedA},
{"", URL_APPLY_GUESSSCHEME | URL_APPLY_DEFAULT, S_OK, 7, "http://"},
{"", URL_APPLY_GUESSSCHEME, S_FALSE, TEST_APPLY_MAX_LENGTH, untouchedA},
{"", URL_APPLY_DEFAULT, S_OK, 7, "http://"}
......
......@@ -1764,20 +1764,6 @@ HRESULT WINAPI UrlApplySchemeW(LPCWSTR pszIn, LPWSTR pszOut, LPDWORD pcchOut, DW
return ret;
}
}
else {
/* we have a scheme, see if valid (known scheme) */
if (in_scheme.nScheme) {
/* have valid scheme, so just copy and exit */
if (strlenW(pszIn) + 1 > *pcchOut) {
*pcchOut = strlenW(pszIn) + 1;
return E_POINTER;
}
strcpyW(pszOut, pszIn);
*pcchOut = strlenW(pszOut);
TRACE("valid scheme, returning copy\n");
return S_OK;
}
}
/* If we are here, then either invalid scheme,
* or no scheme and can't/failed guess.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment