From 31ab5ec2d7ea977e2649b8402822776c2e1540c9 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Mon, 3 Jun 2024 16:46:51 -0600 Subject: [PATCH] ntdll: Do not ignore trailing dots in match_filename(). --- dlls/ntdll/tests/directory.c | 10 +++------- dlls/ntdll/unix/file.c | 4 ++-- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/dlls/ntdll/tests/directory.c b/dlls/ntdll/tests/directory.c index b2484609689..f02a95bc391 100644 --- a/dlls/ntdll/tests/directory.c +++ b/dlls/ntdll/tests/directory.c @@ -453,13 +453,12 @@ static void test_NtQueryDirectoryFile(void) { const WCHAR *mask; int found[ARRAY_SIZE(testfiles)]; - BOOL todo_missing; } mask_tests[] = { - {L"*.", {0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1}, TRUE}, - {L"*.*", {1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1}, TRUE}, - {L"*.**", {1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1}, TRUE}, + {L"*.", {0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1}}, + {L"*.*", {1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1}}, + {L"*.**", {1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1}}, {L"*", {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}}, {L"**", {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}}, {L"??.???", {0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0}}, @@ -517,10 +516,7 @@ static void test_NtQueryDirectoryFile(void) RtlInitUnicodeString(&mask, mask_tests[i].mask); test_flags_NtQueryDirectoryFile(&attr, testdirA, &mask, FALSE, TRUE); for (j = 0; j < test_dir_count; j++) - { - todo_wine_if(mask_tests[i].todo_missing && !mask_tests[i].found[j]) ok(testfiles[j].nfound == mask_tests[i].found[j], "%S, got %d.\n", testfiles[j].name, testfiles[j].nfound); - } winetest_pop_context(); } diff --git a/dlls/ntdll/unix/file.c b/dlls/ntdll/unix/file.c index 1cafe7aa8b7..ce3bc24c5f4 100644 --- a/dlls/ntdll/unix/file.c +++ b/dlls/ntdll/unix/file.c @@ -1487,8 +1487,8 @@ static BOOLEAN match_filename( const WCHAR *name, int length, const UNICODE_STRI break; } } - while (mask < mask_end && ((*mask == '.') || (*mask == '*'))) - mask++; /* Ignore trailing '.' or '*' in mask */ + while (mask < mask_end && *mask == '*') + mask++; return (name == name_end && mask == mask_end); }