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

fix(builder): Sub-string check

Fixes #282
This commit is contained in:
Michael Carlberg 2016-12-30 20:34:13 +01:00
parent 18cf9df86c
commit dffdc6a20b

View file

@ -313,7 +313,7 @@ void builder::space() {
void builder::remove_trailing_space(size_t len) {
if (len == 0_z || len > m_output.size()) {
return;
} else if (string(m_output.rbegin() + len, m_output.rbegin()) == string(len, ' ')) {
} else if (m_output.substr(m_output.size() - len) == string(len, ' ')) {
m_output.erase(m_output.size() - len);
}
}