mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-05-20 11:53:48 +00:00
Fixed parsing of Config from AMF / 3MF if it started with an empty line.
This bug was introduced with e947a29fc8
This commit is contained in:
@@ -696,10 +696,8 @@ ConfigSubstitutions ConfigBase::load_from_ini_string_commented(std::string &&dat
|
|||||||
for (size_t i = 0; i < data.size();)
|
for (size_t i = 0; i < data.size();)
|
||||||
if (i == 0 || data[i] == '\n') {
|
if (i == 0 || data[i] == '\n') {
|
||||||
// Start of a line.
|
// Start of a line.
|
||||||
if (i != 0) {
|
if (data[i] == '\n') {
|
||||||
// Consume LF.
|
// Consume LF, don't keep empty lines.
|
||||||
assert(data[i] == '\n');
|
|
||||||
// Don't keep empty lines.
|
|
||||||
if (j > 0 && data[j - 1] != '\n')
|
if (j > 0 && data[j - 1] != '\n')
|
||||||
data[j ++] = data[i];
|
data[j ++] = data[i];
|
||||||
++ i;
|
++ i;
|
||||||
|
|||||||
Reference in New Issue
Block a user