[PATCH v3 0/1] MR6366: odbccp32: write_registry_values only append slash if required
-- v3: odbccp32: write_registry_values only append slash if required https://gitlab.winehq.org/wine/wine/-/merge_requests/6366
From: Alistair Leslie-Hughes <leslie_alistair(a)hotmail.com> --- dlls/odbccp32/odbccp32.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/dlls/odbccp32/odbccp32.c b/dlls/odbccp32/odbccp32.c index b233f7bfd03..3d07550486b 100644 --- a/dlls/odbccp32/odbccp32.c +++ b/dlls/odbccp32/odbccp32.c @@ -1045,6 +1045,7 @@ static void write_registry_values(const WCHAR *regkey, const WCHAR *driver, cons { if(GetFileAttributesW(divider) == INVALID_FILE_ATTRIBUTES) { + int pathlen = lstrlenW(path); len = lstrlenW(path) + lstrlenW(L"\\") + lstrlenW(divider) + 1; value = malloc(len * sizeof(WCHAR)); if(!value) @@ -1055,7 +1056,8 @@ static void write_registry_values(const WCHAR *regkey, const WCHAR *driver, cons } lstrcpyW(value, path); - lstrcatW(value, L"\\"); + if (pathlen && path[pathlen - 1] != '\\') + lstrcatW(value, L"\\"); } else { -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/6366
This merge request was approved by Hans Leidekker. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/6366
participants (3)
-
Alistair Leslie-Hughes -
Alistair Leslie-Hughes (@alesliehughes) -
Hans Leidekker (@hans)