Module: wine Branch: master Commit: 691ccd64b30d9c4c8777c29980a35b4a072e7c48 URL: https://gitlab.winehq.org/wine/wine/-/commit/691ccd64b30d9c4c8777c29980a35b4...
Author: Paul Gofman pgofman@codeweavers.com Date: Wed Jun 5 16:18:01 2024 -0600
ntdll: Skip name search for wildcards in asterisk handling in match_filename().
---
dlls/ntdll/tests/directory.c | 1 + dlls/ntdll/unix/file.c | 11 +++++++---- 2 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/dlls/ntdll/tests/directory.c b/dlls/ntdll/tests/directory.c index babe0f7a8fe..c05b51860e1 100644 --- a/dlls/ntdll/tests/directory.c +++ b/dlls/ntdll/tests/directory.c @@ -483,6 +483,7 @@ static void test_NtQueryDirectoryFile(void) {L"??.", {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1}}, {L"??.???", {0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}}, {L"<", {0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1}}, + {L"*<a", {0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 1, 0, 1, 1, 0}}, {L"<.", {0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 1}}, {L"<..", {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1}}, {L"<."", {0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 1}}, diff --git a/dlls/ntdll/unix/file.c b/dlls/ntdll/unix/file.c index d3bbcdffdc6..429f8839ed2 100644 --- a/dlls/ntdll/unix/file.c +++ b/dlls/ntdll/unix/file.c @@ -1442,10 +1442,13 @@ static BOOLEAN match_filename_part( const WCHAR *name, const WCHAR *name_end, co while (name < name_end) { c = *mask == '"' ? '.' : *mask; - if (is_case_sensitive) - while (name < name_end && (*name != c)) name++; - else - while (name < name_end && (towupper(*name) != towupper(c))) name++; + if (!is_wildcard(c)) + { + if (is_case_sensitive) + while (name < name_end && (*name != c)) name++; + else + while (name < name_end && (towupper(*name) != towupper(c))) name++; + } if (match_filename_part( name, name_end, mask, mask_end )) return TRUE; ++name; }