1
0
Fork 0
mirror of https://github.com/polybar/polybar.git synced 2024-11-11 13:50:56 -05:00

fix(config): Require wrapping quotes to trim

This commit is contained in:
Michael Carlberg 2016-12-23 14:39:12 +01:00
parent f25830714c
commit 9c14531542

View file

@ -117,7 +117,11 @@ void config::parse_file() {
} }
if (equal_pos + 1 < line.size()) { if (equal_pos + 1 < line.size()) {
value = string_util::trim(forward<string>(string_util::trim(line.substr(equal_pos + 1), ' ')), '"'); value = forward<string>(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)); m_sections[section].emplace_hint(it, move(key), move(value));