16 Dec
2024
16 Dec
'24
7:06 a.m.
From: Lois Gomez <csberto(a)gmail.com> --- dlls/ntdll/path.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/dlls/ntdll/path.c b/dlls/ntdll/path.c index 8956ff07f6c..86b35495885 100644 --- a/dlls/ntdll/path.c +++ b/dlls/ntdll/path.c @@ -966,6 +966,13 @@ 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--; + } + if (size && ptr[size - 1] != '\\') ptr[size++] = '\\'; /* convert \??\UNC\ path to \\ prefix */ -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/7023