From 9c14531542644743d79fe49e7a0e5ab863d732de Mon Sep 17 00:00:00 2001 From: Michael Carlberg Date: Fri, 23 Dec 2016 14:39:12 +0100 Subject: [PATCH] fix(config): Require wrapping quotes to trim --- src/components/config.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/components/config.cpp b/src/components/config.cpp index 270e824c..a057b7c0 100644 --- a/src/components/config.cpp +++ b/src/components/config.cpp @@ -117,7 +117,11 @@ void config::parse_file() { } if (equal_pos + 1 < line.size()) { - value = string_util::trim(forward(string_util::trim(line.substr(equal_pos + 1), ' ')), '"'); + value = forward(string_util::trim(line.substr(equal_pos + 1), ' ')); + size_t len{value.size()}; + if (len > 2 && value[0] == '"' && value[len - 1] == '"') { + value.erase(len - 1, 1).erase(0, 1); + } } m_sections[section].emplace_hint(it, move(key), move(value));