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.
This commit is contained in:
Vadim Zeitlin 2023-09-30 23:20:16 +02:00
parent d18a16c401
commit 5406a8f0c2
2 changed files with 4 additions and 4 deletions

View file

@ -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

View file

@ -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);
}
}