mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-08-09 18:54:04 +02:00
[Win32] Avoid superfluous '/' from g_file_resolve_relative_path()
Patch from bug #591532.
This commit is contained in:
committed by
Tor Lillqvist
parent
1b298d6a1b
commit
406c3aa019
@@ -375,9 +375,19 @@ g_winhttp_file_resolve_relative_path (GFile *file,
|
|||||||
|
|
||||||
if (*wnew_path != '/')
|
if (*wnew_path != '/')
|
||||||
{
|
{
|
||||||
wchar_t *tmp = g_new (wchar_t, wcslen (winhttp_file->url.lpszUrlPath) + 1 + wcslen (wnew_path) + 1);
|
wchar_t *tmp = NULL;
|
||||||
wcscpy (tmp, winhttp_file->url.lpszUrlPath);
|
int trailing_slash = winhttp_file->url.lpszUrlPath[winhttp_file->url.dwUrlPathLength-1] == L'/'? 1 : 0;
|
||||||
wcscat (tmp, L"/");
|
if (trailing_slash)
|
||||||
|
{
|
||||||
|
tmp = g_new (wchar_t, wcslen (winhttp_file->url.lpszUrlPath) + wcslen (wnew_path) + 1);
|
||||||
|
wcscpy (tmp, winhttp_file->url.lpszUrlPath);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
tmp = g_new (wchar_t, wcslen (winhttp_file->url.lpszUrlPath) + 1 + wcslen (wnew_path) + 1);
|
||||||
|
wcscpy (tmp, winhttp_file->url.lpszUrlPath);
|
||||||
|
wcscat (tmp, L"/");
|
||||||
|
}
|
||||||
wcscat (tmp, wnew_path);
|
wcscat (tmp, wnew_path);
|
||||||
|
|
||||||
g_free (wnew_path);
|
g_free (wnew_path);
|
||||||
|
Reference in New Issue
Block a user