From: Lois Gomez csberto@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..252cc045c80 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--; /* Remove the dot */ + } + if (size && ptr[size - 1] != '\') ptr[size++] = '\';
/* convert ??\UNC\ path to \ prefix */