mirror of
https://github.com/reactos/wine.git
synced 2024-11-26 13:10:28 +00:00
shlwapi: Don't copy valid scheme in UrlApplySchemeW.
This commit is contained in:
parent
2034439d66
commit
2e1bec528f
@ -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.
|
||||
|
Loading…
Reference in New Issue
Block a user