Commit 01219c65 authored by Robert Shearman's avatar Robert Shearman Committed by Alexandre Julliard

wininet: The host name is optional in InternetCreateUrlW.

parent ed90c868
......@@ -3743,7 +3743,8 @@ static BOOL calc_url_length(LPURL_COMPONENTSW lpUrlComponents,
*lpdwUrlLength += URL_GET_COMP_LENGTH(lpUrlComponents, Password);
}
*lpdwUrlLength += URL_GET_COMP_LENGTH(lpUrlComponents, HostName);
if (lpUrlComponents->lpszHostName)
*lpdwUrlLength += URL_GET_COMP_LENGTH(lpUrlComponents, HostName);
if (!url_uses_default_port(lpUrlComponents))
{
......@@ -3945,9 +3946,12 @@ BOOL WINAPI InternetCreateUrlW(LPURL_COMPONENTSW lpUrlComponents, DWORD dwFlags,
lpszUrl++;
}
dwLen = URL_GET_COMP_LENGTH(lpUrlComponents, HostName);
memcpy(lpszUrl, lpUrlComponents->lpszHostName, dwLen * sizeof(WCHAR));
lpszUrl += dwLen;
if (lpUrlComponents->lpszHostName)
{
dwLen = URL_GET_COMP_LENGTH(lpUrlComponents, HostName);
memcpy(lpszUrl, lpUrlComponents->lpszHostName, dwLen * sizeof(WCHAR));
lpszUrl += dwLen;
}
if (!url_uses_default_port(lpUrlComponents))
{
......
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