Merge pull request #353 from mgerhardy/master

Fixed find_last_of call in GetBaseFilename
This commit is contained in:
Syoyo Fujita 2022-03-14 14:50:32 +09:00 committed by GitHub
commit 1a7c7d2001
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2041,8 +2041,7 @@ static std::string GetBaseDir(const std::string &filepath) {
}
static std::string GetBaseFilename(const std::string &filepath) {
constexpr char path_separators[2] = { '/', '\\' };
auto idx = filepath.find_last_of(path_separators);
auto idx = filepath.find_last_of("/\\");
if (idx != std::string::npos)
return filepath.substr(idx + 1);
return filepath;