From: Lois Gomez <csberto(a)gmail.com> --- dlls/ntdll/path.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/dlls/ntdll/path.c b/dlls/ntdll/path.c index 8956ff07f6c..452fc5cfa84 100644 --- a/dlls/ntdll/path.c +++ b/dlls/ntdll/path.c @@ -966,6 +966,15 @@ NTSTATUS WINAPI RtlSetCurrentDirectory_U(const UNICODE_STRING* dir) ptr = newdir.Buffer; ptr += 4; /* skip \??\ prefix */ size -= 4; + + /* remove trailing '.' if present */ + if (size && ptr[size - 1] == '.' && + (size == 1 || ptr[size - 2] == '\\') + && !(size > 1 && ptr[size - 2] == '.')) + { + size--; + } + if (size && ptr[size - 1] != '\\') ptr[size++] = '\\'; /* convert \??\UNC\ path to \\ prefix */ -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/7023