Signed-off-by: Zebediah Figura z.figura12@gmail.com --- Based on patch 0002 of this series, this seems like a better solution than the relevant Staging patch:
https://raw.githubusercontent.com/wine-staging/wine-staging/master/patches/n...
I know of no application that is helped by this patch.
dlls/ntdll/directory.c | 2 ++ dlls/ntdll/tests/file.c | 6 +++--- 2 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/dlls/ntdll/directory.c b/dlls/ntdll/directory.c index 64b0afc4ca0..f30b7ffa2ad 100644 --- a/dlls/ntdll/directory.c +++ b/dlls/ntdll/directory.c @@ -2590,6 +2590,8 @@ static NTSTATUS lookup_unix_name( const WCHAR *name, int name_len, char **buffer { if (!stat( unix_name, &st )) { + while (IS_SEPARATOR(unix_name[pos + ret])) + unix_name[pos + ret--] = 0; if (disposition == FILE_CREATE) return STATUS_OBJECT_NAME_COLLISION; return STATUS_SUCCESS; diff --git a/dlls/ntdll/tests/file.c b/dlls/ntdll/tests/file.c index dde5441cd9e..e225e180cf5 100644 --- a/dlls/ntdll/tests/file.c +++ b/dlls/ntdll/tests/file.c @@ -2097,7 +2097,7 @@ static void test_file_rename_information(void) res = pNtQueryInformationFile( handle, &io, fni, sizeof(FILE_NAME_INFORMATION) + MAX_PATH * sizeof(WCHAR), FileNameInformation ); ok( res == STATUS_SUCCESS, "res expected STATUS_SUCCESS, got %x\n", res ); fni->FileName[ fni->FileNameLength / sizeof(WCHAR) ] = 0; - todo_wine ok( !lstrcmpiW(fni->FileName, newpath + 2), "FileName expected %s, got %s\n", + ok( !lstrcmpiW(fni->FileName, newpath + 2), "FileName expected %s, got %s\n", wine_dbgstr_w(newpath + 2), wine_dbgstr_w(fni->FileName) ); HeapFree( GetProcessHeap(), 0, fni );
@@ -3227,10 +3227,10 @@ static void test_file_name_information(void) ok(!U(io).Status, "Got io.Status %#x.\n", U(io).Status); ok(info->FileNameLength == wcslen( L"\windows\system" ) * sizeof(WCHAR), "info->FileNameLength is %u\n", info->FileNameLength); - todo_wine ok(info->FileName[info->FileNameLength / sizeof(WCHAR)] == 0xcccc, + ok(info->FileName[info->FileNameLength / sizeof(WCHAR)] == 0xcccc, "info->FileName[len] is %#x, expected 0xcccc.\n", info->FileName[info->FileNameLength / sizeof(WCHAR)]); info->FileName[info->FileNameLength / sizeof(WCHAR)] = '\0'; - todo_wine ok(!wcsicmp( info->FileName, L"\windows\system" ), "Got file name %s.\n", debugstr_w( info->FileName )); + ok(!wcsicmp( info->FileName, L"\windows\system" ), "Got file name %s.\n", debugstr_w( info->FileName )); ok(io.Information == FIELD_OFFSET(FILE_NAME_INFORMATION, FileName) + info->FileNameLength, "io.Information is %lu, expected %u.\n", io.Information, FIELD_OFFSET(FILE_NAME_INFORMATION, FileName) + info->FileNameLength);