-- v3: odbccp32: write_registry_values only append slash if required
From: Alistair Leslie-Hughes leslie_alistair@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 {
This merge request was approved by Hans Leidekker.