tinyRenderer, remove both \r and \n, not just \n
This commit is contained in:
@@ -407,7 +407,7 @@ std::string LoadMtl(
|
|||||||
}
|
}
|
||||||
if (linebuf.size() > 0)
|
if (linebuf.size() > 0)
|
||||||
{
|
{
|
||||||
if (linebuf[linebuf.size() - 1] == '\n') linebuf.erase(linebuf.size() - 1);
|
if (linebuf[linebuf.size() - 1] == '\r') linebuf.erase(linebuf.size() - 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Skip if empty line.
|
// Skip if empty line.
|
||||||
@@ -417,7 +417,6 @@ std::string LoadMtl(
|
|||||||
}
|
}
|
||||||
|
|
||||||
linebuf = linebuf.substr(0, linebuf.find_last_not_of(" \t") + 1);
|
linebuf = linebuf.substr(0, linebuf.find_last_not_of(" \t") + 1);
|
||||||
|
|
||||||
// Skip leading space.
|
// Skip leading space.
|
||||||
const char* token = linebuf.c_str();
|
const char* token = linebuf.c_str();
|
||||||
token += strspn(token, " \t");
|
token += strspn(token, " \t");
|
||||||
|
|||||||
Reference in New Issue
Block a user