if res_{class,name} is null, it is set to broken (which is just
"broken") to avoid calling strstr() with NULL.

but doing this can end up having false positive matches. so set them to
an empty string instead of "broken".
---
 dwm.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/dwm.c b/dwm.c
index e5efb6a..0e32987 100644
--- a/dwm.c
+++ b/dwm.c
@@ -289,8 +289,8 @@ applyrules(Client *c)
        c->isfloating = 0;
        c->tags = 0;
        XGetClassHint(dpy, c->win, &ch);
-       class    = ch.res_class ? ch.res_class : broken;
-       instance = ch.res_name  ? ch.res_name  : broken;
+       class    = ch.res_class ? ch.res_class : "";
+       instance = ch.res_name  ? ch.res_name  : "";
 
        for (i = 0; i < LENGTH(rules); i++) {
                r = &rules[i];
-- 
2.35.1


Reply via email to