mirror of
https://git.mirrors.martin98.com/https://github.com/syoyo/tinygltf.git
synced 2025-07-06 05:05:09 +08:00
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:
parent
6ed7c39d71
commit
fae6543b7a
@ -2041,8 +2041,7 @@ static std::string GetBaseDir(const std::string &filepath) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static std::string GetBaseFilename(const std::string &filepath) {
|
static std::string GetBaseFilename(const std::string &filepath) {
|
||||||
constexpr char path_separators[2] = { '/', '\\' };
|
auto idx = filepath.find_last_of("/\\");
|
||||||
auto idx = filepath.find_last_of(path_separators);
|
|
||||||
if (idx != std::string::npos)
|
if (idx != std::string::npos)
|
||||||
return filepath.substr(idx + 1);
|
return filepath.substr(idx + 1);
|
||||||
return filepath;
|
return filepath;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user