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

fix(builder): Escape all colons in action command

Fixes #984
This commit is contained in:
patrick96 2018-10-10 16:46:40 +02:00 committed by NBonaparte
parent fa693aecf8
commit 18e2609f11

View file

@ -499,11 +499,7 @@ void builder::underline_close() {
*/ */
void builder::cmd(mousebtn index, string action, bool condition) { void builder::cmd(mousebtn index, string action, bool condition) {
if (condition && !action.empty()) { if (condition && !action.empty()) {
size_t p{0}; action = string_util::replace_all(action, ":", "\\:");
while ((p = action.find(':', p)) != string::npos && action[p - 1] != '\\') {
action.insert(p, 1, '\\');
p++;
}
tag_open(syntaxtag::A, to_string(static_cast<int>(index)) + ":" + action + ":"); tag_open(syntaxtag::A, to_string(static_cast<int>(index)) + ":" + action + ":");
} }
} }