diff options
| author | tslil <tslil@posteo.de> | 2026-04-04 17:44:21 +0100 |
|---|---|---|
| committer | tslil <tslil@posteo.de> | 2026-04-04 17:47:21 +0100 |
| commit | 5413fb67d5454666cd4606ac51e8f8d1ae31aa6e (patch) | |
| tree | effd7869b631e1e1a455b65eea1a1f12263b4bba /dwl/correctly-match-blank-rule-strings.patch | |
| parent | 0c860a57966d4c0f4ef817b9c7f378de4623a236 (diff) | |
cleanup
Diffstat (limited to 'dwl/correctly-match-blank-rule-strings.patch')
| -rw-r--r-- | dwl/correctly-match-blank-rule-strings.patch | 35 |
1 files changed, 0 insertions, 35 deletions
diff --git a/dwl/correctly-match-blank-rule-strings.patch b/dwl/correctly-match-blank-rule-strings.patch deleted file mode 100644 index f9b3144..0000000 --- a/dwl/correctly-match-blank-rule-strings.patch +++ /dev/null @@ -1,35 +0,0 @@ -From 7cc541eb1092ba17bfe3d5afa77e609cda832016 Mon Sep 17 00:00:00 2001 -From: tslil clingman <> -Date: Sat, 2 Dec 2023 10:57:35 +0100 -Subject: [PATCH 1/1] correctly match blank rule strings - -The bug before-hand was that specifying a blank rule string would -match against any string (strstr(foo, "") is always true apparently), -even though we already had a special case for !r->title and !r->id. - -This patch now sets the behaviour to r->title/r->id == NULL means -match all, blank means match blank ---- - dwl.c | 5 +++-- - 1 file changed, 3 insertions(+), 2 deletions(-) - -diff --git a/dwl.c b/dwl.c -index 03e999e..5a2a538 100644 ---- a/dwl.c -+++ b/dwl.c -@@ -442,9 +442,10 @@ applyrules(Client *c) - if (!(title = client_get_title(c))) - title = broken; - -+#define MATCH(str1, str2) ((str2[0]==0 && str1[0]==0) || (str2[0] != 0 && strstr(str1, str2))) - for (r = rules; r < END(rules); r++) { -- if ((!r->title || strstr(title, r->title)) -- && (!r->id || strstr(appid, r->id))) { -+ if ((!r->title || MATCH(title, r->title)) -+ && (!r->id || MATCH(appid, r->id))) { - c->isfloating = r->isfloating; - newtags |= r->tags; - i = 0; --- -2.43.0 - |
