[PATCH 08/11] xfree86: Add InputClass match type for non-path pattern matching

Dan Nicholson dbn.lists at gmail.com
Thu May 20 07:09:10 PDT 2010


We had MatchPathPattern for shell pattern matching on paths, and this
adds a normal variant, MatchPattern. The difference is the FNM_PATHNAME
flag in fnmatch(3).

Signed-off-by: Dan Nicholson <dbn.lists at gmail.com>
---
 hw/xfree86/common/xf86Xinput.c |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/hw/xfree86/common/xf86Xinput.c b/hw/xfree86/common/xf86Xinput.c
index 2396e33..0304c55 100644
--- a/hw/xfree86/common/xf86Xinput.c
+++ b/hw/xfree86/common/xf86Xinput.c
@@ -526,6 +526,16 @@ MatchSubstring(const char *attr, const char *pattern)
 
 #ifdef HAVE_FNMATCH_H
 static int
+MatchPattern(const char *attr, const char *pattern)
+{
+    return fnmatch(pattern, attr, 0);
+}
+#else
+#define MatchPattern MatchSubstring
+#endif
+
+#ifdef HAVE_FNMATCH_H
+static int
 MatchPathPattern(const char *attr, const char *pattern)
 {
     return fnmatch(pattern, attr, FNM_PATHNAME);
-- 
1.6.6.1



More information about the xorg-devel mailing list