aboutsummaryrefslogtreecommitdiff
path: root/src/ClientPattern.cc
diff options
context:
space:
mode:
authorfluxgen <fluxgen>2005-10-20 14:50:50 (GMT)
committerfluxgen <fluxgen>2005-10-20 14:50:50 (GMT)
commit88de9987f722d5ae32d9933f0e882e82e5d2bb27 (patch)
treea7fefebb93a5a256f21a4294ea20e93fdaaef61f /src/ClientPattern.cc
parenta9f9e6d6eec6a42921e4446baef92eb5b2356d60 (diff)
downloadfluxbox-88de9987f722d5ae32d9933f0e882e82e5d2bb27.zip
fluxbox-88de9987f722d5ae32d9933f0e882e82e5d2bb27.tar.bz2
add backslash to special chars, fixes bug #1327878
Diffstat (limited to 'src/ClientPattern.cc')
-rw-r--r--src/ClientPattern.cc8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/ClientPattern.cc b/src/ClientPattern.cc
index c93708a..7cd4ce1 100644
--- a/src/ClientPattern.cc
+++ b/src/ClientPattern.cc
@@ -169,7 +169,13 @@ std::string ClientPattern::toString() const {
169 Terms::const_iterator it = m_terms.begin(); 169 Terms::const_iterator it = m_terms.begin();
170 Terms::const_iterator it_end = m_terms.end(); 170 Terms::const_iterator it_end = m_terms.end();
171 for (; it != it_end; ++it) { 171 for (; it != it_end; ++it) {
172
172 pat.append(" ("); 173 pat.append(" (");
174 // replace special chars like ( ) and [ ] with \( \) and \[ \]
175 string orig = FbTk::StringUtil::replaceString((*it)->orig, "(", "\\(");
176 orig = FbTk::StringUtil::replaceString(orig, ")", "\\)");
177 orig = FbTk::StringUtil::replaceString(orig, "[", "\\[");
178 orig = FbTk::StringUtil::replaceString(orig, "]", "\\]");
173 179
174 switch ((*it)->prop) { 180 switch ((*it)->prop) {
175 case NAME: 181 case NAME:
@@ -185,7 +191,7 @@ std::string ClientPattern::toString() const {
185 pat.append("role="); 191 pat.append("role=");
186 } 192 }
187 193
188 pat.append((*it)->orig); 194 pat.append(orig);
189 pat.append(")"); 195 pat.append(")");
190 } 196 }
191 197