diff options
author | bubnikv <bubnikv@gmail.com> | 2020-03-11 20:12:16 +0300 |
---|---|---|
committer | bubnikv <bubnikv@gmail.com> | 2020-03-11 20:12:16 +0300 |
commit | cd381d6b4f723528b6714002ffbba112a98116f6 (patch) | |
tree | 9bcc294da883b1d0a53371103047da2f3d52d0cb /src/slic3r/GUI/AppConfig.hpp | |
parent | a4a6ef3c72bb18b0f249e27a19081412ec239362 (diff) |
More robust vendor profile parsing.
Diffstat (limited to 'src/slic3r/GUI/AppConfig.hpp')
-rw-r--r-- | src/slic3r/GUI/AppConfig.hpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/slic3r/GUI/AppConfig.hpp b/src/slic3r/GUI/AppConfig.hpp index 58e04433b..c1c4607ec 100644 --- a/src/slic3r/GUI/AppConfig.hpp +++ b/src/slic3r/GUI/AppConfig.hpp @@ -5,6 +5,8 @@ #include <map> #include <string> +#include <boost/algorithm/string/trim_all.hpp> + #include "libslic3r/Config.hpp" #include "libslic3r/Semver.hpp" @@ -52,7 +54,13 @@ public: std::string get(const std::string &key) const { std::string value; this->get("", key, value); return value; } void set(const std::string §ion, const std::string &key, const std::string &value) - { + { +#ifndef _NDEBUG + std::string key_trimmed = key; + boost::trim_all(key_trimmed); + assert(key_trimmed == key); + assert(! key_trimmed.empty()); +#endif _NDEBUG std::string &old = m_storage[section][key]; if (old != value) { old = value; |