wininet: Changed usage of UrlEscapeW to fit winapi behavior.

Signed-off-by: Fabian Maurer <dark.shadow4@web.de>
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Fabian Maurer 2016-12-14 16:47:50 +01:00 committed by Alexandre Julliard
parent e2e0c747a8
commit 8c39694882
1 changed files with 5 additions and 4 deletions

View File

@ -4189,12 +4189,13 @@ static DWORD HTTP_HandleRedirect(http_request_t *request, LPCWSTR lpszUrl)
request->path = NULL;
if (*path)
{
DWORD needed = 0;
DWORD needed = 1;
HRESULT rc;
WCHAR dummy = 0;
rc = UrlEscapeW(path, NULL, &needed, URL_ESCAPE_SPACES_ONLY);
if (rc == E_POINTER)
needed = strlenW(path)+1;
rc = UrlEscapeW(path, &dummy, &needed, URL_ESCAPE_SPACES_ONLY);
if (rc != E_POINTER)
ERR("Unable to escape string!(%s) (%d)\n",debugstr_w(path),rc);
request->path = heap_alloc(needed*sizeof(WCHAR));
rc = UrlEscapeW(path, request->path, &needed,
URL_ESCAPE_SPACES_ONLY);