all repos — fluxbox @ 8588402376c57890deb7cd77f56bef4337f00b63

custom fork of the fluxbox windowmanager

don't escape regex metacharacters when writing apps file
markt markt
commit

8588402376c57890deb7cd77f56bef4337f00b63

parent

9910094bd10d857b250e3e7826a4305695ed23a0

3 files changed, 15 insertions(+), 7 deletions(-)

jump to
M ChangeLogChangeLog

@@ -1,5 +1,9 @@

(Format: Year/Month/Day) Changes for 1.0rc3: +*07/01/02: + * Don't escape regular expression metacharacters in apps file, bug + #1595497 (Mark) + Remember.cc ClientPattern.cc *07/01/01: * Happy New Year! * Don't draw style's menu icon pixmap underneath the program's icon (Mark)
M src/ClientPattern.ccsrc/ClientPattern.cc

@@ -170,11 +170,6 @@ 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:

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

pat.append("role="); } - pat.append(orig); + pat.append((*it)->orig); pat.append(")"); }
M src/Remember.ccsrc/Remember.cc

@@ -302,8 +302,17 @@

Application * Remember::add(WinClient &winclient) { ClientPattern *p = new ClientPattern(); Application *app = new Application(false); + // by default, we match against the WMClass of a window. - p->addTerm(p->getProperty(ClientPattern::NAME, winclient), ClientPattern::NAME); + string win_name = p->getProperty(ClientPattern::NAME, winclient); + + // replace special chars like ( ) and [ ] with \( \) and \[ \] + win_name = FbTk::StringUtil::replaceString(win_name, "(", "\\("); + win_name = FbTk::StringUtil::replaceString(win_name, ")", "\\)"); + win_name = FbTk::StringUtil::replaceString(win_name, "[", "\\["); + win_name = FbTk::StringUtil::replaceString(win_name, "]", "\\]"); + + p->addTerm(win_name, ClientPattern::NAME); m_clients[&winclient] = app; p->addMatch(); m_pats->push_back(make_pair(p, app));