Fixed find_last_of call in GetBaseFilename

this leads to a stack overflow on linux - it looks like this magically works on msvc though...
This commit is contained in:
Martin Gerhardy 2022-03-13 18:42:39 +01:00
parent 6ed7c39d71
commit fae6543b7a

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;