[PATCH] Added case insensitive matching.

Danny Baumann dannybaumann at web.de
Wed Jun 20 05:48:33 PDT 2007


---
 plugins/regex.c |   15 ++++++++++-----
 1 files changed, 10 insertions(+), 5 deletions(-)

diff --git a/plugins/regex.c b/plugins/regex.c
index 90a764f..779bc92 100644
--- a/plugins/regex.c
+++ b/plugins/regex.c
@@ -168,11 +168,16 @@ regexMatchInitExp (CompDisplay  *d,
 	char		     *s;
 	int		     len;
 	CompMatchExpEvalProc eval;
+	unsigned int         flags;
     } prefix[] = {
-	{ "title=", 6, regexMatchExpEvalTitle },
-	{ "role=",  5, regexMatchExpEvalRole  },
-	{ "class=", 6, regexMatchExpEvalClass },
-	{ "name=",  5, regexMatchExpEvalName  }
+	{ "title=", 6, regexMatchExpEvalTitle, 0 },
+	{ "role=",  5, regexMatchExpEvalRole, 0  },
+	{ "class=", 6, regexMatchExpEvalClass, 0 },
+	{ "name=",  5, regexMatchExpEvalName, 0  },
+	{ "ititle=", 7, regexMatchExpEvalTitle, REG_ICASE },
+	{ "irole=",  6, regexMatchExpEvalRole, REG_ICASE  },
+	{ "iclass=", 7, regexMatchExpEvalClass, REG_ICASE },
+	{ "iname=",  6, regexMatchExpEvalName, REG_ICASE  },
     };
     int	i;
 
@@ -193,7 +198,7 @@ regexMatchInitExp (CompDisplay  *d,
 
 	    value += prefix[i].len;
 
-	    status = regcomp (preg, value, REG_NOSUB);
+	    status = regcomp (preg, value, REG_NOSUB | prefix[i].flags);
 	    if (status)
 	    {
 		char errMsg[1024];
-- 
1.5.2.1


--=-NtyxLGJ8MTKqT6IzoC6W--



More information about the compiz mailing list