[PATCH v2 0/1] MR6366: odbccp32: write_registry_values only append slash if required
-- v2: 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 dba24e4b673..fec7b841574 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 (path[pathlen-1] != '\\') + lstrcatW(value, L"\\"); } else { -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/6366
Hans Leidekker (@hans) commented about dlls/odbccp32/odbccp32.c:
}
lstrcpyW(value, path); - lstrcatW(value, L"\\"); + if (path[pathlen-1] != '\\') + lstrcatW(value, L"\\");
`if (pathlen && path[pathlen - 1] != '\\') lstrcatW(value, L"\\");` to be safe. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/6366#note_80256
participants (3)
-
Alistair Leslie-Hughes -
Alistair Leslie-Hughes (@alesliehughes) -
Hans Leidekker (@hans)