JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
Fix match function bugs
[st.git] / st.c
diff --git a/st.c b/st.c
index 2809592..66aca2d 100644 (file)
--- a/st.c
+++ b/st.c
@@ -3355,17 +3355,17 @@ focus(XEvent *ev) {
        }
 }
 
-inline bool
+static inline bool
 match(uint mask, uint state) {
-       state &= ~(ignoremod);
+       state &= ~ignoremod;
 
        if(mask == XK_NO_MOD && state)
                return false;
        if(mask != XK_ANY_MOD && mask != XK_NO_MOD && !state)
                return false;
-       if((state & mask) != state)
-               return false;
-       return true;
+       if(mask == XK_ANY_MOD)
+               return true;
+       return state == mask;
 }
 
 void