Skip to content

Commit

Permalink
Canonicalize file names
Browse files Browse the repository at this point in the history
  • Loading branch information
momo5502 committed Sep 28, 2024
1 parent b87be69 commit 25133bc
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/windows-emulator/module/module_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,17 @@ module_manager::module_manager(emulator& emu)

mapped_module* module_manager::map_module(const std::filesystem::path& file, logger& logger)
{
const auto canonical_file = canonical(absolute(file));

for (auto& mod : this->modules_)
{
if (mod.second.path == file)
if (mod.second.path == canonical_file)
{
return &mod.second;
}
}

auto mod = map_module_from_file(*this->emu_, file);
auto mod = map_module_from_file(*this->emu_, std::move(canonical_file));
if (!mod)
{
logger.error("Failed to map %s\n", file.generic_string().c_str());
Expand Down

0 comments on commit 25133bc

Please sign in to comment.