From 88de9987f722d5ae32d9933f0e882e82e5d2bb27 Mon Sep 17 00:00:00 2001 From: fluxgen Date: Thu, 20 Oct 2005 14:50:50 +0000 Subject: add backslash to special chars, fixes bug #1327878 --- src/ClientPattern.cc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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 { 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 @@ std::string ClientPattern::toString() const { pat.append("role="); } - pat.append((*it)->orig); + pat.append(orig); pat.append(")"); } -- cgit v0.11.2