diff options
| author | luigi1111 <luigi1111w@gmail.com> | 2024-07-16 19:03:10 -0400 |
|---|---|---|
| committer | luigi1111 <luigi1111w@gmail.com> | 2024-07-16 19:03:10 -0400 |
| commit | 76feeb64b7060f588739d1a267bcf8000be6f817 (patch) | |
| tree | d312148efa0ebeabfb5ba3d21b9b0cf6cdeff41d | |
| parent | 61db6497f7203bc0aaff3a8e7bf0cc91280a0ae7 (diff) | |
| parent | b9fddc08b2e861042b5770d01560a92a1d2f1676 (diff) | |
| download | monzero-core-76feeb64b7060f588739d1a267bcf8000be6f817.tar.gz monzero-core-76feeb64b7060f588739d1a267bcf8000be6f817.tar.xz monzero-core-76feeb64b7060f588739d1a267bcf8000be6f817.zip | |
Merge pull request #9396
b9fddc0 epee: fix mlog filename compare bug. (0xFFFC0000)
| -rw-r--r-- | contrib/epee/src/mlog.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/contrib/epee/src/mlog.cpp b/contrib/epee/src/mlog.cpp index 4ca1a3632..46b535504 100644 --- a/contrib/epee/src/mlog.cpp +++ b/contrib/epee/src/mlog.cpp @@ -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()); } |
