fix: prevent IWD paths from matching nested filenames (#908)

Fixes https://github.com/Laupetin/OpenAssetTools/issues/887
This commit is contained in:
mo
2026-07-18 11:44:55 +02:00
committed by GitHub
parent 33352e5391
commit 786ccc14d3
2 changed files with 33 additions and 3 deletions
@@ -31,7 +31,7 @@ namespace
return false;
path = parentDir.string();
prefix = combinedPath.filename().string();
prefix = combinedPath.string();
}
return true;
@@ -77,7 +77,7 @@ void SearchPathFilesystem::Find(const SearchPathSearchOptions& options, const st
continue;
auto entryPath = entry->path();
if (!prefix.empty() && !entryPath.filename().string().starts_with(prefix))
if (!prefix.empty() && !entryPath.string().starts_with(prefix))
continue;
if (options.m_filter_extensions && entryPath.extension().string() != options.m_extension)
@@ -104,7 +104,7 @@ void SearchPathFilesystem::Find(const SearchPathSearchOptions& options, const st
continue;
auto entryPath = entry->path();
if (!prefix.empty() && !entryPath.filename().string().starts_with(prefix))
if (!prefix.empty() && !entryPath.string().starts_with(prefix))
continue;
if (options.m_filter_extensions && entryPath.extension().string() != options.m_extension)