From 8e28ca6f4a86410e6ed0093899d6b857ad5c7035 Mon Sep 17 00:00:00 2001 From: Vojtech Bubnik Date: Fri, 13 Aug 2021 10:52:44 +0200 Subject: [PATCH] Fixed reading of configuration from 3MF broken with e947a29fc88f098febd2d93a8d9acf8ccedd4229 --- src/libslic3r/Config.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/libslic3r/Config.cpp b/src/libslic3r/Config.cpp index 41ee9231f..b7facbe0e 100644 --- a/src/libslic3r/Config.cpp +++ b/src/libslic3r/Config.cpp @@ -659,8 +659,9 @@ ConfigSubstitutions ConfigBase::load_from_ini_string_commented(std::string &&dat // Consume LF. assert(data[i] == '\n'); // Don't keep empty lines. - if (j != 0 && data[j] != '\n') - data[j ++] = data[i ++]; + if (j > 0 && data[j - 1] != '\n') + data[j ++] = data[i]; + ++ i; } // Skip all leading spaces; for (; i < data.size() && (data[i] == ' ' || data[i] == '\t'); ++ i) ;