Fix the dwUrlPathLength returned by InternetCrackUrl when

lpszExtraInfo is null.
This commit is contained in:
Mike McCormack 2004-08-06 18:57:53 +00:00 committed by Alexandre Julliard
parent 7d18f57120
commit efbb50bc25
1 changed files with 10 additions and 12 deletions

View File

@ -1155,6 +1155,9 @@ BOOL SetUrlComponentValueW(LPWSTR* lppszComponent, LPDWORD dwComponentLen, LPCWS
{ {
TRACE("%s (%d)\n", debugstr_wn(lpszStart,len), len); TRACE("%s (%d)\n", debugstr_wn(lpszStart,len), len);
if ( (*dwComponentLen == 0) && (*lppszComponent == NULL) )
return FALSE;
if (*dwComponentLen != 0 || *lppszComponent == NULL) if (*dwComponentLen != 0 || *lppszComponent == NULL)
{ {
if (*lppszComponent == NULL) if (*lppszComponent == NULL)
@ -1221,11 +1224,8 @@ BOOL WINAPI InternetCrackUrlW(LPCWSTR lpszUrl, DWORD dwUrlLength, DWORD dwFlags,
lpszParam = strpbrkW(lpszap, lpszSeparators); lpszParam = strpbrkW(lpszap, lpszSeparators);
if (lpszParam != NULL) if (lpszParam != NULL)
{ {
if (!SetUrlComponentValueW(&lpUC->lpszExtraInfo, &lpUC->dwExtraInfoLength, SetUrlComponentValueW(&lpUC->lpszExtraInfo, &lpUC->dwExtraInfoLength,
lpszParam, dwUrlLength-(lpszParam-lpszUrl))) lpszParam, dwUrlLength-(lpszParam-lpszUrl));
{
return FALSE;
}
} }
if (bIsAbsolute) /* Parse <protocol>:[//<net_loc>] */ if (bIsAbsolute) /* Parse <protocol>:[//<net_loc>] */
@ -1235,9 +1235,8 @@ BOOL WINAPI InternetCrackUrlW(LPCWSTR lpszUrl, DWORD dwUrlLength, DWORD dwFlags,
/* Get scheme first. */ /* Get scheme first. */
lpUC->nScheme = GetInternetSchemeW(lpszUrl, lpszcp - lpszUrl); lpUC->nScheme = GetInternetSchemeW(lpszUrl, lpszcp - lpszUrl);
if (!SetUrlComponentValueW(&lpUC->lpszScheme, &lpUC->dwSchemeLength, SetUrlComponentValueW(&lpUC->lpszScheme, &lpUC->dwSchemeLength,
lpszUrl, lpszcp - lpszUrl)) lpszUrl, lpszcp - lpszUrl);
return FALSE;
/* Eat ':' in protocol. */ /* Eat ':' in protocol. */
lpszcp++; lpszcp++;
@ -1374,7 +1373,7 @@ BOOL WINAPI InternetCrackUrlW(LPCWSTR lpszUrl, DWORD dwUrlLength, DWORD dwFlags,
/* Only truncate the parameter list if it's already been saved /* Only truncate the parameter list if it's already been saved
* in lpUC->lpszExtraInfo. * in lpUC->lpszExtraInfo.
*/ */
if (lpszParam && lpUC->dwExtraInfoLength) if (lpszParam && lpUC->dwExtraInfoLength && lpUC->lpszExtraInfo)
len = lpszParam - lpszcp; len = lpszParam - lpszcp;
else else
{ {
@ -1388,9 +1387,8 @@ BOOL WINAPI InternetCrackUrlW(LPCWSTR lpszUrl, DWORD dwUrlLength, DWORD dwFlags,
len = dwUrlLength-(lpszcp-lpszUrl); len = dwUrlLength-(lpszcp-lpszUrl);
} }
if (!SetUrlComponentValueW(&lpUC->lpszUrlPath, &lpUC->dwUrlPathLength, SetUrlComponentValueW(&lpUC->lpszUrlPath, &lpUC->dwUrlPathLength,
lpszcp, len)) lpszcp, len);
return FALSE;
} }
else else
{ {