diff options
author | fluxgen <fluxgen> | 2005-10-20 14:50:50 (GMT) |
---|---|---|
committer | fluxgen <fluxgen> | 2005-10-20 14:50:50 (GMT) |
commit | 88de9987f722d5ae32d9933f0e882e82e5d2bb27 (patch) | |
tree | a7fefebb93a5a256f21a4294ea20e93fdaaef61f /src | |
parent | a9f9e6d6eec6a42921e4446baef92eb5b2356d60 (diff) | |
download | fluxbox_pavel-88de9987f722d5ae32d9933f0e882e82e5d2bb27.zip fluxbox_pavel-88de9987f722d5ae32d9933f0e882e82e5d2bb27.tar.bz2 |
add backslash to special chars, fixes bug #1327878
Diffstat (limited to 'src')
-rw-r--r-- | src/ClientPattern.cc | 8 |
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 | ||