all repos — fluxbox @ 88de9987f722d5ae32d9933f0e882e82e5d2bb27

custom fork of the fluxbox windowmanager

add backslash to special chars, fixes bug #1327878
fluxgen fluxgen
commit

88de9987f722d5ae32d9933f0e882e82e5d2bb27

parent

a9f9e6d6eec6a42921e4446baef92eb5b2356d60

1 files changed, 7 insertions(+), 1 deletions(-)

jump to
M src/ClientPattern.ccsrc/ClientPattern.cc

@@ -169,7 +169,13 @@ string pat;

Terms::const_iterator it = m_terms.begin(); Terms::const_iterator it_end = m_terms.end(); for (; it != it_end; ++it) { + pat.append(" ("); + // replace special chars like ( ) and [ ] with \( \) and \[ \] + string orig = FbTk::StringUtil::replaceString((*it)->orig, "(", "\\("); + orig = FbTk::StringUtil::replaceString(orig, ")", "\\)"); + orig = FbTk::StringUtil::replaceString(orig, "[", "\\["); + orig = FbTk::StringUtil::replaceString(orig, "]", "\\]"); switch ((*it)->prop) { case NAME:

@@ -185,7 +191,7 @@ case ROLE:

pat.append("role="); } - pat.append((*it)->orig); + pat.append(orig); pat.append(")"); }