From f92312b597e198ba20fb5b91bb3ceaddee178479 Mon Sep 17 00:00:00 2001 From: Vojtech Bubnik Date: Mon, 30 Aug 2021 17:56:58 +0200 Subject: [PATCH] Fixed parsing of Config from AMF / 3MF if it started with an empty line. This bug was introduced with e947a29fc88f098febd2d93a8d9acf8ccedd4229 --- src/libslic3r/Config.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/libslic3r/Config.cpp b/src/libslic3r/Config.cpp index c8a3835dd..ab58a43aa 100644 --- a/src/libslic3r/Config.cpp +++ b/src/libslic3r/Config.cpp @@ -696,10 +696,8 @@ ConfigSubstitutions ConfigBase::load_from_ini_string_commented(std::string &&dat for (size_t i = 0; i < data.size();) if (i == 0 || data[i] == '\n') { // Start of a line. - if (i != 0) { - // Consume LF. - assert(data[i] == '\n'); - // Don't keep empty lines. + if (data[i] == '\n') { + // Consume LF, don't keep empty lines. if (j > 0 && data[j - 1] != '\n') data[j ++] = data[i]; ++ i;