[PATCH] xfree86: fix multiple InputAttributes tag matching.

Jamey Sharp jamey at minilop.net
Sun May 23 19:34:41 PDT 2010


Reviewed-by: Jamey Sharp <jamey at minilop.net>

On Sun, May 23, 2010 at 7:25 PM, Peter Hutterer
<peter.hutterer at who-t.net> wrote:
> 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
>
> _______________________________________________
> xorg-devel at lists.x.org: X.Org development
> Archives: http://lists.x.org/archives/xorg-devel
> Info: http://lists.x.org/mailman/listinfo/xorg-devel
>


More information about the xorg-devel mailing list