From 4d2bd364420df43f0815a10a0c3ca322be4cb102 Mon Sep 17 00:00:00 2001 From: "John R. Sheets" Date: Sun, 23 Jul 2000 13:34:21 +0000 Subject: [PATCH] Put the URL parameter list in with the URL path if the ExtraInfo buffer isn't specified. --- dlls/wininet/internet.c | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/dlls/wininet/internet.c b/dlls/wininet/internet.c index 79b556de16c..d71aefa437e 100644 --- a/dlls/wininet/internet.c +++ b/dlls/wininet/internet.c @@ -646,9 +646,27 @@ BOOL WINAPI InternetCrackUrlA(LPCSTR lpszUrl, DWORD dwUrlLength, DWORD dwFlags, */ if (lpszcp != 0 && *lpszcp != '\0' && (!lpszParam || lpszcp < lpszParam)) { + INT len; + + /* Only truncate the parameter list if it's already been saved + * in lpUrlComponents->lpszExtraInfo. + */ + if (lpszParam && lpUrlComponents->dwExtraInfoLength) + len = lpszParam - lpszcp; + else + { + /* Leave the parameter list in lpszUrlPath. Strip off any trailing + * newlines if necessary. + */ + LPSTR lpsznewline = strchr (lpszcp, '\n'); + if (lpsznewline != NULL) + len = lpsznewline - lpszcp; + else + len = strlen(lpszcp); + } + if (!SetUrlComponentValue(&lpUrlComponents->lpszUrlPath, - &lpUrlComponents->dwUrlPathLength, lpszcp, - lpszParam ? lpszParam - lpszcp : strlen(lpszcp))) + &lpUrlComponents->dwUrlPathLength, lpszcp, len)) return FALSE; } else @@ -656,7 +674,8 @@ BOOL WINAPI InternetCrackUrlA(LPCSTR lpszUrl, DWORD dwUrlLength, DWORD dwFlags, lpUrlComponents->dwUrlPathLength = 0; } - TRACE("%s: host(%s) path(%s)\n", lpszUrl, lpUrlComponents->lpszHostName, lpUrlComponents->lpszUrlPath); + TRACE("%s: host(%s) path(%s) extra(%s)\n", lpszUrl, lpUrlComponents->lpszHostName, + lpUrlComponents->lpszUrlPath, lpUrlComponents->lpszExtraInfo); return TRUE; } -- 2.11.4.GIT