[PATCH] xfree86: fix multiple InputAttributes tag matching.

Peter Hutterer peter.hutterer at who-t.net
Sun May 23 19:25:15 PDT 2010


attr->tags is an array of strings (null-terminated). When matching, match
against each string instead of each [i,end] substring in the first tag.

Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
---
Surprisingly, there's only a limited set of configurations where matching a
tag of "foobar" against "oobar", "obar", "bar", "ar" and "r" is useful :)

 hw/xfree86/common/xf86Xinput.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/hw/xfree86/common/xf86Xinput.c b/hw/xfree86/common/xf86Xinput.c
index 6e08c87..0d00470 100644
--- a/hw/xfree86/common/xf86Xinput.c
+++ b/hw/xfree86/common/xf86Xinput.c
@@ -551,9 +551,9 @@ InputClassMatches(XF86ConfInputClassPtr iclass, InputAttributes *attrs)
             return FALSE;
 
         for (cur = iclass->match_tag, match = FALSE; *cur && !match; cur++) {
-            const char *tag;
-            for(tag = *attrs->tags; *tag; tag++) {
-                if (!strcmp(tag, *cur)) {
+            char * const *tag;
+            for(tag = attrs->tags; *tag; tag++) {
+                if (!strcmp(*tag, *cur)) {
                     match = TRUE;
                     break;
                 }
-- 
1.7.0.1



More information about the xorg-devel mailing list