From 5406a8f0c2500779a368e4af0805874e5fd927ac Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 30 Sep 2023 23:20:16 +0200 Subject: [PATCH] Don't use newer PathMatchSpecEx() unnecessarily Use older and so hopefully compatible with all MinGW versions PathMatchSpec() instead as we don't use any of the newer function flags and it seems to behave identically with the default flag. --- src/msw/dir.cpp | 2 +- tests/file/dir.cpp | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/msw/dir.cpp b/src/msw/dir.cpp index 7254b6553c..f406a91281 100644 --- a/src/msw/dir.cpp +++ b/src/msw/dir.cpp @@ -76,7 +76,7 @@ CheckFoundMatch(const FIND_STRUCT* finddata, const wxString& filter) if ( filter.empty() ) return true; - return ::PathMatchSpecEx(finddata->cFileName, filter, PMSF_NORMAL) == S_OK; + return ::PathMatchSpec(finddata->cFileName, filter) == TRUE; } inline bool diff --git a/tests/file/dir.cpp b/tests/file/dir.cpp index 17d715b108..fa2b836900 100644 --- a/tests/file/dir.cpp +++ b/tests/file/dir.cpp @@ -167,7 +167,7 @@ TEST_CASE_METHOD(DirTestCase, "Dir::Traverse", "[dir]") } else if (wxDir::GetAllFiles(DIRTEST_FOLDER, &files, "d" + WILDCARD_ALL) == 4) { - WARN("PathMatchSpecEx() seems to work under Wine now"); + WARN("PathMatchSpec() seems to work under Wine now"); } // enum all files according to the filter @@ -287,14 +287,14 @@ TEST_CASE("Dir::Match", "[.]") // Show the results of matching the pattern using various functions. wxPrintf("%-15s %20s %20s %20s\n", - "File", "wxString::Matches", "wxMatchWild", "PathMatchSpecEx"); + "File", "wxString::Matches", "wxMatchWild", "PathMatchSpec"); for ( const auto& fn : filenames ) { wxPrintf("%-15s %20d %20d %20d\n", fn, fn.Matches(filter), wxMatchWild(filter, fn), - PathMatchSpecEx(fn.wc_str(), filter.wc_str(), PMSF_NORMAL) == S_OK); + PathMatchSpec(fn.wc_str(), filter.wc_str()) == TRUE); } }