Skip to content

Commit

Permalink
Merge pull request #9392
Browse files Browse the repository at this point in the history
b894042 epee: fix mlog filename compare bug. (0xFFFC0000)
  • Loading branch information
luigi1111 committed Jul 16, 2024
2 parents 3b53db4 + b894042 commit caa62bc
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions contrib/epee/src/mlog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -176,11 +176,12 @@ void mlog_configure(const std::string &filename_base, bool console, const std::s
std::vector<boost::filesystem::path> found_files;
const boost::filesystem::directory_iterator end_itr;
const boost::filesystem::path filename_base_path(filename_base);
const std::string filename_base_name = filename_base_path.filename().string();
const boost::filesystem::path parent_path = filename_base_path.has_parent_path() ? filename_base_path.parent_path() : ".";
for (boost::filesystem::directory_iterator iter(parent_path); iter != end_itr; ++iter)
{
const std::string filename = iter->path().string();
if (filename.size() >= filename_base.size() && std::memcmp(filename.data(), filename_base.data(), filename_base.size()) == 0)
const std::string filename = iter->path().filename().string();
if (filename.size() >= filename_base_name.size() && std::memcmp(filename.data(), filename_base_name.data(), filename_base_name.size()) == 0)
{
found_files.push_back(iter->path());
}
Expand Down

0 comments on commit caa62bc

Please sign in to comment.