mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-05-19 19:33:47 +00:00
Fixed parsing of older PrusaSlicer.ini files.
This commit is contained in:
@@ -812,13 +812,11 @@ static boost::optional<Semver> parse_semver_from_ini(std::string path)
|
|||||||
std::stringstream buffer;
|
std::stringstream buffer;
|
||||||
buffer << stream.rdbuf();
|
buffer << stream.rdbuf();
|
||||||
std::string body = buffer.str();
|
std::string body = buffer.str();
|
||||||
size_t end_line = body.find_first_of("\n\r");
|
|
||||||
body.resize(end_line);
|
|
||||||
size_t start = body.find("PrusaSlicer ");
|
size_t start = body.find("PrusaSlicer ");
|
||||||
if (start == std::string::npos)
|
if (start == std::string::npos)
|
||||||
return boost::none;
|
return boost::none;
|
||||||
body = body.substr(start + 12);
|
body = body.substr(start + 12);
|
||||||
size_t end = body.find_first_of(" \n\r");
|
size_t end = body.find_first_of(" \n");
|
||||||
if (end < body.size())
|
if (end < body.size())
|
||||||
body.resize(end);
|
body.resize(end);
|
||||||
return Semver::parse(body);
|
return Semver::parse(body);
|
||||||
|
|||||||
Reference in New Issue
Block a user